cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Lookup to be added on Screen

Hi All, I am new to this Power Platform. As part of exploring the Power Apps, I started off creating some basic apps. While doing that, I was trying to create a contact from App and want to show the account lookup on the screen. I am not using any form or gallery, instead I am using blank screen and adde all my required feilds. I am able to create a new contact in CDS (D365) without Account, but I want to add Account to it and if the required account is not avaialble from the lookup, it should create an account and map it to that contat.

 

If(
!(PasswordTextInput.Text = ReEnterPasswordTextInput.Text),
Notify(
"Passwords not matching",
NotificationType.Error
),
Patch(
Contacts,
{'First Name':FirstNameTextInput.Text,
'Last Name':LastNameTextInput.Text,
Password:PasswordTextInput.Text,
Email:EmailTextInput.Text,
'Business Phone':PhoneNumberTextInput.Text }
)
); Navigate(SuccessScreen,None)

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Lookup to be added on Screen

Hi @krishnags,

Could you please share a bit more about your scenario?

Do you want to list the available accounts from the Accounts Entity of your CDS within your app?

If you want to list the available accounts from the Accounts Entity of your CDS within your app, I think the Combo Box control could achieve your needs. I have made a test on my side, please take a try with the following workaround:9.JPG

 

8.JPG

Within your app, add your Accounts Entity as a data source, then add a Combo Box control within the screen of your app, set the Items property of the Combo Box control to following:

Accounts

Within the Right Pop-Up panel, set the Primary text field and SearchField both to FullName column.

Please check the attached GIF screenshot for more details:

 

I assume that you have created a Account Name column (Text Type column) in your Contacts Entity already, please modify your formula as below:

If(
  !(PasswordTextInput.Text = ReEnterPasswordTextInput.Text),
  Notify("Passwords not matching", NotificationType.Error),
  Patch(
        Contacts,
Defaults(Contacts), /* <- Modify formula here */ {
'First Name':FirstNameTextInput.Text, 'Last Name':LastNameTextInput.Text, Password: PasswordTextInput.Text, Email: EmailTextInput.Text, 'Business Phone': PhoneNumberTextInput.Text,
AccountName: ComboBox1.Selected.FullName /* <- Add formula here , ComboxBox1 represents the ComboBox control in your app*/
} ) );
Navigate(SuccessScreen,None)

More details about the Patch function, please check the following article:

Patch function

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Lookup to be added on Screen

Hi @krishnags,

Could you please share a bit more about your scenario?

Do you want to list the available accounts from the Accounts Entity of your CDS within your app?

If you want to list the available accounts from the Accounts Entity of your CDS within your app, I think the Combo Box control could achieve your needs. I have made a test on my side, please take a try with the following workaround:9.JPG

 

8.JPG

Within your app, add your Accounts Entity as a data source, then add a Combo Box control within the screen of your app, set the Items property of the Combo Box control to following:

Accounts

Within the Right Pop-Up panel, set the Primary text field and SearchField both to FullName column.

Please check the attached GIF screenshot for more details:

 

I assume that you have created a Account Name column (Text Type column) in your Contacts Entity already, please modify your formula as below:

If(
  !(PasswordTextInput.Text = ReEnterPasswordTextInput.Text),
  Notify("Passwords not matching", NotificationType.Error),
  Patch(
        Contacts,
Defaults(Contacts), /* <- Modify formula here */ {
'First Name':FirstNameTextInput.Text, 'Last Name':LastNameTextInput.Text, Password: PasswordTextInput.Text, Email: EmailTextInput.Text, 'Business Phone': PhoneNumberTextInput.Text,
AccountName: ComboBox1.Selected.FullName /* <- Add formula here , ComboxBox1 represents the ComboBox control in your app*/
} ) );
Navigate(SuccessScreen,None)

More details about the Patch function, please check the following article:

Patch function

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (13,987)