cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Dual Super User III
Dual Super User III

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

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!

Highlighted
Anonymous
Not applicable

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

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

 

Highlighted
Anonymous
Not applicable

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

Highlighted
Anonymous
Not applicable

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

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

Helpful resources

Announcements
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,377)