Working with Dynamics 365 entity records in Canvas PowerApps

Working with Dynamics 365 entity records in Canvas PowerApps

When creating a Canvas PowerApp connected to Dynamics 365/CDS, you may want to present the values in an entity as options within a drop down box (combo box) or a list box for selection. This would be useful if you wanted to present select-able data in a more user-friendly manner than the standard out of the box lookup functionality. A typical scenario might be selecting a lookup value to associate to a record e.g. Expense Type lookup on an expense entity. I’ll show how we can present the Expense Types below in both a combo box and list box.

Working with Dynamics 365 entity records in Canvas PowerApps

The steps are as follows:

  1. Connect to the CDS Entity that has the values you want to populate the control(s) with.
Working with Dynamics 365 entity records in Canvas PowerApps

2. Create a Collection with that data source.

Working with Dynamics 365 entity records in Canvas PowerApps

3. Add a Combo Box or List Box control and update the ‘Items’ property to the collection created in step 2

4. For a Combo Box, update the DisplayFields and SearchFields property to the schema name of the field you want displayed

Working with Dynamics 365 entity records in Canvas PowerApps

5. For a List Box, update the ‘Value’ property to the schema name of the field you want to display.

Working with Dynamics 365 entity records in Canvas PowerApps

6. Thats it! The screenshots below the 2 controls on a CanvasApp with the values populated with the records from the Expense Type entity from Dynamics

Working with Dynamics 365 entity records in Canvas PowerApps
Combo box not selected
Working with Dynamics 365 entity records in Canvas PowerApps
Combo Box selected with values showing

Hopefully this gives you a quick reference and starting point on how to work with and manipulate controls with entity records. There are further optimizations that could be made when dealing with collections of entity records e.g. only creating a collection with the columns that you actually need. This isnt covered here but it is considered best practice and should be done before anything goes into production 🙂