This Power Apps Tutorial will discuss how to get data from Dynamic 365 using MS Flow.
We will also see how to search records from Dataverse Account Entity on clicking a button using the Power automate from the canvas app.
Step 1
We will Create MS Flow to get data from the dynamic 365 account entity and send a response to the canvas app.
Navigate to https://make.powerapps.com/
Once the above link opens, please click on flows from the left navigation and click on new flow.
Please select instant cloud flow
As per the requirement, give the flow name and select PowerApps.
The next step is to create two variables, Name and City, because our application will search based on these two inputs.
The next step is to select list rows from the power app where we need to select our entity (Ex: Account entity) and click on show advanced options to write our Fetch XML that we have downloaded from advance find.
We can get the counts of each record.
Create one variable and give this formula "@length(body('List_rows')?['value'])" as per the below screen.
The next step is to create compose and Body inputs fields.
Now we need to add step parse JSON in the content field and add Outputs as value, and we need to generate our JSON Structure.
Note: if we don't know how to generate JSON, please run the flow till the above compose step and take generated JSON.
Now we need to apply each condition to map fields from the output that we are getting. Please follow the screen below.
The final step is a response, and in the Body column, we need to add value and click on Show advanced option to generate a JSON template.
Finally, our MS Flow will look like the below screen.
Step 2
Create a canvas app and design your app as per the below screen.
Next step, we need to bind our MS Flow when the user clicks the search button. Please find the below screen for reference.
Add a Data Table to the Canvas app to display search results.
In the item property, enter Flow Output because while binding flow we have set variable Flow Output to get a response from MS flow.
Click on the edit field and your fields in the data table based on your needs.
Final screen with output.