Power Apps using Microsoft Flow to Create Dynamics 365 records

Introduction

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 Power Apps

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

  • Canvas Apps
  • Model-Driven
  • Common Data Service

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

Steps to Create Dynamics 365 record from Power Apps using Microsoft Flow

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

Infographics show the Create Dynamics 365 record from PowerApps

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

Infographics show the Create an app and click on Canvas - Power Apps using the Microsoft Flow

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

Infographics show the Blank app and Phone layout

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

Infographics show the add Textboxes

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

Infographics show the click on Create a new flow - Power Apps using the Microsoft Flow

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

Infographics show the 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.

Infographics show the use for data connectivity - Microsoft Flow Connector

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.

Infographics show the 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.

Infographics show the selection of our entity

Transform Your Workflow with Power Apps

Enhance your Dynamics 365 environment with custom Power Apps and Microsoft Flow integrations. Discover how we can elevate your business efficiency.

Request a Demo

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

Infographics show the Dynamics content selection

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

Infographics show the Save the flow

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.

Infographics show the 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)”.

Infographics show the OnSelect function of the button

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

Infographics show the PowerApps to test run button

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.

Infographics show the verify it from Dynamics 365 CRM
Infographics show the apps screen second

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

Infographics show the save powerapps

Streamline Your Dynamics 365 Operations

Leverage the power of Power Apps and Microsoft Flow to automate and optimize your Dynamics 365 record creation. Let our experts guide your transformation.

Request a Demo

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

Infographics show the 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 Power Apps.

Infographics show the open PowerApps weblinks

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

Infographics show the Power Apps 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.

Infographics show the verify it in Dynamics 365 CRM

Conclusion

We have created a basic Canvas Power Apps from scratch by utilizing Microsoft Flow as a connector to create records in Dynamic 365. If you have any question or queries, do not hesitate to reach out to us! 

Explore Recent Blog Posts

4 thoughts on “Power Apps using Microsoft Flow to Create Dynamics 365 records”

  1. Hi I am getting invalid argument type (error). Expecting a Text value instead .

    location scree1.OnVisible

  2. Hi Maruf,

    We need more information, would you please identify at which step and expressions you are receiving this error?

    Regards,
    BOLDEnthusiasts

  3. This is great. Can you tell me under who’s context the flow runs? If we share the App with other users and they create a contact record will the created by be the flow owner or the current user who is using the app ?

  4. Hi Bushan,
    If your flow is running on an automated trigger, it will always run in the context of a flow. If the App/flow is shared with another user team, then it will run on the user context so the owner of the record will be the one who is using the App/flow
    Let me know if you need any further help.

Comments are closed.