Show LOOKUP field as dropdown in PowerApp & update value in D365 Sales
Recently, I got a case where I need to show a lookup field as dropdown in Canvas App and update its value in D365 Sales. I have searched a lot over the internet but failed. In my opinion, there is no handy material available for this problem at internet. So, after lots of struggle I found a solution that I am going to share with you all through this blog. So that, it will make someoneâs day.
In this blog we will have below sections:
- Show lookup field as dropdown in Canvas App
- Update selected value in lookup field of Dynamics 365 Sales entity
Letâs start with section 1
In D365 Sales, on the âAccountâ entity, there is a âContactâ lookup, the âPrimary Contactâ field.
Now, letâs see how we can show that as a dropdown on the Canvas App.
- Click on âData Sourceâ icon and select âDynamics 365â from list of connectors

- Click on âAdd a connectionâ for creating new connection with Dynamics 365.

- After creating new connection choose required tables from the given list. In my case I have selected âAccountsâ and âContactsâ. Then click âConnectâ.

- Now, design your app as per your requirement. From Contact lookup field insert a dropdown. Open itâs properties, set Items as Contacts and Value as Full Name. This will display all the contacts from the Contact entity in dropdown.

Here, weâre done with the first part.
Now, here comes another section, updating selected value into the lookup field of the Dynamics 365 Sales entity.
Add a button on your App. The OnSelect property of the button when you will patch the record, for the lookup field, youâll see value, id and Type. Select the value part.

- Write below code on OnSelect property of button

Patch(
Accounts,
{
'Account Name': ti_AccountName.Text,
'Primary Contact (_primarycontactid_value)': dd_PrimaryContact.Selected.Contact
}
);
Thatâs it. Weâre done with the both the parts.
Above steps will successfully create an account and update Primary Contact lookup value into the Account entity.

I hope this will help you!!
ATM Inspection PowerApp to ease ATM inspection and report generation process.
https://powerapps.microsoft.com/en-us/partner-showcase/inkey-solutions-atm-inspection/
Insert data into Many-to-Many relationship in Dynamics CRM very easily & quickly, using the Drag and drop listbox.
https://stg.inkeysolutions.com/what-we-do/dynamicscrmaddons/drag-and-drop-listbox
Comply your Lead, Contact, and User entities of D365 CRM with GDPR compliance using the GDPR add-on.
https://stg.inkeysolutions.com/microsoft-dynamics-365/dynamicscrmaddons/gdpr
Create a personal / system view in Dynamics CRM with all the fields on the form/s which you select for a particular entity using the View Creator.
https://stg.inkeysolutions.com/what-we-do/dynamicscrmaddons/view-creator