PowerApps using Microsoft Flow to Create Dynamics 365 records

In this post we will try to achieve a way to create new “contacts” records in Dynamics 365 CRM with the help of Microsoft Flow connector.

Intro PowerApps:

With the help of Microsoft PowerApps, we can build the apps that run on browser, tablets and on smartphones. PowerApps has three most important additives:

  • Canvas Apps
  • Model-Driven
  • Common Data Service

In this blog we're focusing on canvas apps of Microsoft PowerApps. Canvas apps permit us to work with 200 data sources.

Steps to Create Dynamics 365 record from PowerApps using Microsoft Flow

Step 1: Login to PowerApps using https://web.powerapps.com/home.

Create Dynamics 365 record from PowerApps

Step 2: Now Go to Apps > Create an app and click on Canvas.

Create an app and click on Canvas

Step 3: After that it will ask for the selection of canvas. Here we will select from the Blank app and Phone layout.

Blank app and Phone layout

Step 4: Now we will add Textboxes, Labels and Button on the canvas.

add Textboxes

Step 5: Now Go to Action > Flows > and click on Create a new flow.

click on Create a new flow

Step 6: In the next step, it will take us to the flow with the same credential as the one used in the PowerApps site. Now click on New Step as shown in the image below:

same credential PowerApps site

Step 7: In the next step, it will ask for the Flow connector that will be used for data connectivity. We will search action and select Create a new record.

used for data connectivity

Step 8: In this step, we will select the Organization Name and Entity Name that we want to utilize to save the record. In our scenario, we will select the contact.

Organization Name and Entity Name

Step 9: After selection of our entity, it will show us a full list of fields that are available in our Contact entity.

selection of our entity

Step 10: In this step, we will map the fields that we have in the PowerApps Canvas to the fields that are available in the list using Dynamics content selection as shown in image below.

Dynamics content selection

Step 11: After completing the mapping we will now save the Flow so we can utilize it in our PowerApps. Click on Save.

completing the mapping

Step 12: Now our created Flow will be shown in the list and we can utilize it for Data connectivity with Dynamics 365 org on which we need to perform the operations.

Data conectivity with Dynamics 365 org

Step 13: We will trigger the Flow on the Click of Button. To call this we will use following expression on the OnSelect function of the button.

“PowerAppsbutton.Run(txtLastName, txtFirstName, txtLastName)”.

OnSelect function of the button

Step 14: After completing we will click on the Run button for the PowerApps to test.

PowerApps to test

Step 15: In the next step, once we click on the Run button, we will see the apps screen. Fill the field with our desired values and click Save, and then we can verify it from Dynamics 365 CRM.

verify it from Dynamics 365 CRM

apps screen second

Step 16: In this step, we will save our PowerApp.

save powerapps

Step 17: We can also share PowerApps with any user that we want to.

share PowerApps with any user

Step 18: After successfully saving we will see the screen below and from there we can click on the highlighted link to open our PowerApps.

open PowerApps weblinks

Step 19: Once we click on the link it will open our PowerApps. As shown in the image below:

PowerApps open

Step 20: After saving the record we will verify it in Dynamics 365 CRM. We can see both records that we created during the test run and the one which is highlighted is the one we just created.

verify it in Dynamics 365 CRM

Hope this will be helpful.

Thanks!!!

Conclusion

We have created a basic Canvas PowerApps from scratch by utilizing Microsoft Flow as a connector to create records in Dynamic 365.

Leave a Reply

Your email address will not be published. Required fields are marked *