cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
krishnags
Level: Powered On

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,
PasswordSmiley TongueasswordTextInput.Text,
Email:EmailTextInput.Text,
'Business Phone'Smiley TonguehoneNumberTextInput.Text }
)
); Navigate(SuccessScreen,None)

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

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.
1 REPLY 1
Community Support Team
Community Support Team

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.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Users Online
Currently online: 183 members 4,904 guests
Please welcome our newest community members: