Passing variable/JSON from Power Automate to Canvas App

In this post, we will look at passing variable(s) from power automate to a Canvas App. Prerequisite for this post will be:

  • Access to Power Automate
  • Access to Create a canvas App
  • A single dynamics 365/power platform license.

We would create manually create and spit out a Json out via our power automate, call the power automate in the canvas App and make use of the output in canvas App.

The flow should look this:

Power automate flow

Our trigger will be powerApps, next in line should to initialise an object:

In the object, I am passing my name, job tiletile, age and location as a json object. the object will need to be parsed in a json parser connector. The content will be the object created earlier and in the schema, you can click on generate and paste the Json inside the schema.

lets pass some of the paremeter parsed in json to our power App.

we are passing name and Job title

Run the flow and make sure every step runs.

Now let’s our canvas App. In the below I have created a blank canvas App, with a button and two labels. The button will trigger our flow and we would paste the returned result in the label.

In the button, click on it, and onselect, click on the power automate button above in the ribbon to add the power automate created earlier.

In the above, after clicking the power automate button, click on the power automate you want to utilised and in the button onSelect trigger, paste the above highlighted method. We are setting two variable called Victor and Job, with the returned values from the power automate flow we created. I have also added cancatenated the variable created to the label like this:

Run your canvas App, and click on the button, the labels should be populated with the returned values: