cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Microsoft
Microsoft

Parse Json in Flow to PowerApps

Hi all,

I've got a flow that pulls data from Azure AD via Graph and i've got it all working up until I try to return the data into my PowerApp, where I want to put it into a Gallery.  My very last step before the Return to Powerapps is a Parse JSON and i'm stuck figuring out how to get the data from there back to my PowerApp Gallery.  My results is an array, so i've tried Select, Apply to Each, and various other attempts to turn the data into a format the Gallery is compatible with to no avail...  

Stuck...

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted

Hey @JanRichter 

 

Can you try out a few things:
1) Please make sure you have passed a valid JSON schema, not just validated JSON, this should match with the schema of the data that is getting returned. From this I mean sometimes, this returns an array but the JSON passed expects an object.
 
2)Remove the flow from the button and re-register it in the powerapps, so that it point to the latest version of flow. Whenever you make changes to the flow, you should re-register it in the app.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Highlighted

@yashag2255 thank you for great answer, you actually led me to a solution.

 

Removing and re-adding flow to the PowerApp after changes is a great tip, the re-add ended with error message (Registration failed) so I knew I had to tinker more with my Flow - after few minutes I found the problem was in my JSON schema in Response field.

 

Though as you mentioned to check array X object mismatches, the problem wasn't there. I used the automatic generation of schema by example data (directly in Flow), but it actually made all attributes as _required - by making required only few specific columns I really needed from the JSON output, my PowerApps collection finally started having the specified columns in _required (not any others), which is enough for me.

View solution in original post

8 REPLIES 8
Highlighted
Dual Super User III
Dual Super User III

Hi @russrimm 

 

For getting the Parsed JSON response into PowerApps, return the response using the HTTP Response action through your flow. 
Note: Make sure that you are passing the JSON Schema in the request.
 
PowerApps (Canvas App):
Use the below expression on your button "OnSelect" property to trigger the flow after you register flow to your app:
 
ClearCollect(ReturnedResponse, 'PowerApps Flow Name'.Run())
 
Here we are collecting a collection named "ReturnedResponse" and this can be referenced directly to the Gallery Items.MicrosoftTeams-image (167).png

 

Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Highlighted

Thanks Yashag.  So in my parse json step before the response, I have one schema (the schema based on the graph api results).  In the response step after it, what schema should I use - the same?  I tried this, but it doesn't like me putting 200 in the results.  I am getting "The schema definition for action with status code '200' is not valid. The schema definitions for actions with same status code must match."  Ideas?  I'd add a snip I took of the two steps, but the insert photo button here doesn't seem too intuitive :S

Highlighted

HI @russrimm 

 

In my case, I used the same schema in both Parse JSON and Response actions and this works absolutely fine. Can you please share more details about the schema that you are using as part of this flow? For attaching screenshots, maybe try to refresh your browser and then post your reply.

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted

Hi @, I have done flow to parse JSON in similar way to yours, and checked the response JSON text validity - it's valid. Thus I expect that the flow is fine.

 

The problem is - PowerApps doesn't put the JSON contents into the collection, instead only one row, one column: Value = True. Do you know what source of this problem might be? Thanks in advance for the answer.

Capture.PNG

Highlighted

Hey @JanRichter 

 

Can you try out a few things:
1) Please make sure you have passed a valid JSON schema, not just validated JSON, this should match with the schema of the data that is getting returned. From this I mean sometimes, this returns an array but the JSON passed expects an object.
 
2)Remove the flow from the button and re-register it in the powerapps, so that it point to the latest version of flow. Whenever you make changes to the flow, you should re-register it in the app.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Highlighted

@yashag2255 thank you for great answer, you actually led me to a solution.

 

Removing and re-adding flow to the PowerApp after changes is a great tip, the re-add ended with error message (Registration failed) so I knew I had to tinker more with my Flow - after few minutes I found the problem was in my JSON schema in Response field.

 

Though as you mentioned to check array X object mismatches, the problem wasn't there. I used the automatic generation of schema by example data (directly in Flow), but it actually made all attributes as _required - by making required only few specific columns I really needed from the JSON output, my PowerApps collection finally started having the specified columns in _required (not any others), which is enough for me.

View solution in original post

Highlighted
Anonymous
Not applicable

Has anyone solved this functionality, I am trying to get json from Microfot flow to Canvas App, but the data retreived is always empty, although in the microsoft flow it seems that it is passing the correct data. 

Highlighted

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (14,055)