Creating a Power App to Search Products in Dynamics 365 Finance & SCM
I created a tutorial using Contoso data for those who are looking to get more experience building Power Apps and using them with Dynamics 365 Finance and Supply Chain Management. After following the below steps, you will have created a Power App that queries and lists the products in Dynamics using the out of the box connector. We will also add a search capability to query product names based on the provided keyword.
It’s important to note that connecting to Dynamics 365 with a Power App needs a premium license. If you run into any trouble walking through these steps, you can get a 30 day trial by clicking “Try free” on this pricing page. This trial will then need to be applied to the same tenant that is associated with your Dynamics environment and where you are building your Power App from.
Creating the Power App
- Navigate to make.powerapps.com.
- Click the Create tab.
- Click Canvas app from blank under the Start from blank section.
- Type in a name under App name, such as AllProductsDemo. Select Phone for format and click the Create button.
- Your new app workspace will launch. If you get the below prompt, click Skip.
- Click the symbol to open the insert screen where we can begin adding controls to our app.
- Click Vertical gallery and drag it onto the bottom area of your app. We will assume the control name for the Gallery is Gallery1.
- A Select a data source prompt will appear. Type in Fin & Ops and search for the Fin & Ops Apps (Dynamics 365) connector. Click to select the connector.
- Click the Fin & Ops Apps connection again on the next screen. Make sure your Dynamics environment is running or it will fail to connect.
- Under Choose a table, type AllProducts and click the checkbox next to AllProducts. Click Connect.
- Under your Gallery properties, select Title and subtitle for the Layout property.
- Click Edit next to Fields in the Gallery1 properties. Select Product name for the Subtitle field and Product number for the Title field. The selection changes are real-time, and you can close out of the Data selection screen.
- Data should now populate the Gallery control with our selected fields and layout. (Hint: if data isn’t populated, try running your app by pressing F5 or clicking the Preview app button in the top right section of your screen. You can close out of the preview mode by clicking the X icon in the upper right corner of the screen.
- Next, we will learn how to add a keyword search for the product name and repopulate the results in our Gallery. From the insert screen, drag a Text input and Button control into your app.
We will assume the name of these controls are TextInput1 and Button1.
- Click the TextInput1 control and remove the value in the Default property so it is blank. This will prevent our app from searching for products using the default value of “Text input" in later steps.
- Click the Button1 control. Set the Text property to Search Products.
In the On Select event, add the following formula and replace the existing 'false' value that is present:Set(varSearchKeyword, TextInput1.Text)
The varSearchKeyword variable will be updated on the button click with our search keyword to use against the product names. - Click the Gallery1 control (not just the first record in the control). In the Items event, add the following formula and replace the ‘AllProducts’ value that is present:
If( IsBlank(varSearchKeyword), // Load 20 product records by default FirstN(AllProducts,20), // or else query and filter using our keyword for product name Filter(AllProducts, varSearchKeyword in 'Product name') )
Gallery1 will now populate product records from our connection based on the keyword in the varSearchKeyword variable. If varSearchKeyword is blank (such as when the app is first loaded), then it will load the first 20 product records. Otherwise, varSearchKeyword is updated with the contents of TextInput1 when Button1 is clicked, and that keyword will be used to filter the results. - Press F5 or click the Preview app button and we can now query the products in Dynamics 365 Finance and Supply Chain Management with our keyword.
Searching using “Laptop” as a keyword:
Thanks for reading! If you found this blog helpful, please connect with me on LinkedIn for future blog updates. I would love to hear how building your Power App went and how you plan to use Power Apps with Dynamics.

Like
Report
*This post is locked for comments