Logo
banner

Blogs

Send data to the Microsoft flow from the PowerApps and receive the response from the Microsoft flow

, January 10, 2019 7115 Views

The PowerApps is used to build the business apps that can be run in a browser or phone or tablet and the Microsoft flow is used to automate the workflows across the multiple applications and services. Using Microsoft flow in the PowerApps is creating wonders in the business world, making almost everything possible with just one click on the fly.

Let us also move in the same pace as of the technology to use the facilities at its fullness. In this blog, you will learn to send data to the Microsoft flow from the PowerApps and how to return some data from the flow to the PowerApps.

Scenario:

Assume that you have a requirement to create a PowerApp that will create the Account records in the dynamics 365.

The Microsoft flow that will create the Account records will be somewhat like the below screenshot. It will require two parameters to be sent from the PowerApps i.e., Account Name and the Main Phone.

On successfully creating the Account record, the GUID of the newly created Account will be sent to the PowerApp from the Microsoft flow.

Now, let us execute the above Microsoft flow from the PowerApps:-

Below is the PowerApps screen from where the user will submit the data:

Write the below formula in the “OnSelect” property of the “Create Account” button:

//CreateAccount is the name of the flow and we are passing the Account Name and the Main Phone //as parameters to the flow
UpdateContext(
            {
                AccountGUID: CreateAccount.Run(textInputAccountName.Text,textInputMainPhone.Text)
            });
//Now, we will check if the flow has returned the GUID of the newly created Account and send the //notifications accordingly
If(
    !IsBlank(AccountGUID.guid),
    Notify(
        "The Account has been created successfully",
        NotificationType.Success
    ),
    Notify(
        "Something has went wrong. Try again!!",
        NotificationType.Error
    )
)

Result:

When you will click on the “Create Account” button and if the Account gets created in the dynamics 365 successfully then, the flow will return the GUID of the newly created Account to the PowerApps and a success notification will be shown as follows:-

And the Account record will be created in the dynamics 365 as follows:

If due to some reason the Account does not get created in the dynamics 365 then, the flow will return a NULL value to the PowerApps and the error notification will be shown as follows:-

Hip hip hooray… you have learned to pass parameters to the Microsoft flow as well as to respond to the PowerApps from the flow.

I hope this helps you.


 

Insert data into Many-to-Many relationship in Dynamics CRM very easily & quickly, using the Drag and drop listbox.
http://www.inkeysolutions.com/what-we-do/dynamicscrmaddons/drag-and-drop-listbox

Create a personal / system view in Dynamics CRM with all the fields on the form/s which you select for a particular entity using the View Creator.
http://www.inkeysolutions.com/what-we-do/dynamicscrmaddons/view-creator

mm

Inkey

INKEY is your solution partner.
Our focus is to deliver you in-time intelligent innovative solutions ("key") for the problems in hand. Maintaining a quality standard right from the inception of a project is our top most priority.

Our team of talented professionals will execute your projects with dedication and excellence. We take ownership and accountability for the effort that goes into meeting our client’s needs.

Years of experience and proven success of delivering innovative custom solutions.

More posts by

Leave a Reply

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

The maximum upload file size: 2 MB. You can upload: image, audio, video, document, spreadsheet, interactive, text, archive, code, other. Drop file here

Would you like to digitize your business and put it on the cloud?
Do you need clear, concise reports for your organization?