cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Connect with Dynamics 365 and use Lookup Field of Dynamics CRM in PowerApps.

I have a problem with lookup field in D365 in "Contact" Entity. "Contact" entity has look-up field names Company which points to "Account" Entity.

 

I have recently build one power app where user will scan business card and on submit it will create new contact with the associated Account which user have chosen from the list of Accounts. 

 

Now the problem which I am facing here on submit it creating a new contact record as expected with the below patch but the company look-up field is left blank in the new company record. I couldn't able to set the Account name in the look-up field company in Contact Entity. 

I have added few screenshots below and my patch function also which I am using on create Contact button click . 

 

Patch - 

Patch(Contacts_1,Defaults(Contacts),{firstname:txtFirstname.Text,lastname:txtlastName.Text,emailaddress1:txtEmailAddress.Text},LookUp(Accounts_3,_parentcustomerid=First(SelectedAccountRecord).account.accountid,First(SelectedAccountRecord).account.name))

 

Power Apps Look-up issue.PNGPower Apps Look-Up Issue 2.PNG

 

 

4 REPLIES 4
yashag2255
Dual Super User II
Dual Super User II

Hey @Anonymous 

 

This is not working because Account is passed outside the curly brackets. Can you try to update the expression as:

Patch(Contacts_1,Defaults(Contacts_1),{firstname:txtFirstname.Text,lastname:txtlastName.Text,emailaddress1:txtEmailAddress.Text, 'Company Name':
LookUp(Accounts,accountid = First(SelectedAccountRecord).account.accountid,'Account Name'})

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Anonymous
Not applicable

Its still giving the same error. Please refer to the screenshot with error. And when I am using this query its not creating any contact record at all. 

 

Another thing I would like add here the lookup field name in Contact Entity is : parentcustomerid but when I am trying use this field name its showing me invalid column name. 

Any suggestion how can I set the lookup field value : parentcustomerid  with the selected Account name from my  power apps.

 

Power App Look-Up Issue 3.pngPower app look-up issue 4.PNG

 

Anonymous
Not applicable

Anonymous
Not applicable

No I finally I changed to CDS connector and its now working fine

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,379)