Home > CRM, PowerApps > PowerApps – Create an ‘Account’ in Dynamics 365 from App using Flow

PowerApps – Create an ‘Account’ in Dynamics 365 from App using Flow

If you are new to PowerApps, please go through my previous blog

In this post, lets build an App with an Account Form and create the record in Dynamics 365.

PA_Flow_5

Prerequisite:

  • You must have a PowerApps account. Refer blog for details.
  • Create a Microsoft Flow with logic to create an Account record in Dynamics 365
  • Build an App and trigger Flow

Steps to create Flow:

  • Login to PowerApps Portal
  • Navigate to Business Logic -> Flows -> Create from blank

PA_Flow_1

  • In the new Flow screen, Choose Action, select ‘Dynamics 365’

PA_Flow_7

  • Select ‘Create a new record’ from Actions.
  • Now we need to put place holders in the fields which we pass data from PowerApp.
  • To add a place holder to ‘Account Name’ field, select the field, in ‘Dynamics content’ window, click on ‘Ask in PowerApps‘ button.
    • A new place holder will get added to ‘Account Name’ field.

PA_Flow_2

  • I repeated the above step for ‘Main Phone’ and ‘Description’ fields.

PA_Flow_3

  • Rename the Flow to CreateAccount and Save

Invoke Flow from PowerApp:

  • To know, how to create a new App and add controls to form, refer my earlier blog
  • To trigger the Flow, select the ‘Create’ button, go to ‘Action -> Flows’
  • From the ‘Data’ window, select the flow created in above section (i.e.,CreateAccount)

PA_Flow_4

  • On ‘OnSelect’ event of button, trigger the Flow ‘CreateAccount’ by calling ‘Run’ method and passing the 3 placeholder parameters.
    • CreateAccount.Run(txtName.Text,txtDesc.Text,txtMobile.Text)
  • Thats it, now its time to test the App

Test the App:

  • Press F5
  • Set the values and click ‘Create’

PA_Flow_5

  • Open the D365 App and you should see new ‘Account’ record.

PA_Flow_6

Refer my earlier article to build an App using Excel as Data Source.

🙂

Advertisement
  1. Tristan
    January 10, 2019 at 7:51 PM

    Hi Rajeev, Do you know or/and can explain to me how update a record like this ? I have created my App wit my Dynamics Cases Data and i use a Form with DataCards (for having my dynamics cases data) and i want to Edit some DataCard, click on a button and having them update in my crm.

    Thank a lot for your help.

    Tristan

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: