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

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
Dual Super User
Dual Super User

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

Hey @dmukherjee 

 

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!

dmukherjee
Level: Powered On

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

 

dmukherjee
Level: Powered On

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

dmukherjee
Level: Powered On

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
thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (5,423)