cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Append JSON array into Object and send it from response

Good day everyone,

 

I parsed JSON Array with result as below :

 

=====================================

[
{
"id": 16,
"name": "Home & Living",
"label": "Home & Living",
"position": 5
},
{
"id": 4,
"name": "PLN",
"label": "PLN",
"position": 4
},
{
"id": 5,
"name": "Pulsa",
"label": "Pulsa",
"position": 3
},
{
"id": 28,
"name": "Shopping e-Voucher",
"label": "Shopping e-Voucher",
"position": 1
},
{
"id": 56,
"name": "F&B e-Voucher NEW",
"label": "F&B e-Voucher NEW",
"position": 1
}
]

=====================================

 
image.png
 
I was success to get id, name, label and posisition properties into HTML table as below :
 
image.png
 
but I was unable to get it all in response :
 
image.png
 
How can I do that to get all properties into response?
 
My goal is to show all 'name' in the JSON array list from response into dropdown button in PowerApps.
 
really appreciate your help
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Anonymous
Not applicable

Re: Append JSON array into Object and send it from response

I got the answer of my question above.

 

just need to give response body JSON schema into my Response and add body from parse output :

 

image.png

 

after that I can get all of the values in PA :

 

from my collectionfrom my collectioninto my dropdown buttoninto my dropdown button

 

Thanks everyone 🙂

View solution in original post

5 REPLIES 5
Highlighted
Super User II
Super User II

Re: Append JSON array into Object and send it from response

@Anonymous 

Hi there!  Interesting issue, I wonder if the Response needs to be in an Apply to Each loop since your JSON is an array, right?

 

What does the rest of the Flow look like?

 

-Ed-

 

 

If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Highlighted
Anonymous
Not applicable

Re: Append JSON array into Object and send it from response

Hi @edgonzales ,

 

here is my flow :

 

image.png

 

I already tried using apply for each but the result only got 1 object from that array since I need to retrieve all items into powerapps.

 

note : response is forbidden to put in Apply to Each

Highlighted
Super User II
Super User II

Re: Append JSON array into Object and send it from response

Right (on the note), I was thinking about appending the lines to an array inside the loop and then presenting that in the response outside of the loop...but, I'm wondering if I'd be parsing the JSON just to put it back together again in the array.  Did we already consider putting the unparsed output JSON in the response already? Or are you adding data to it before sending it back to PA?

Highlighted
Anonymous
Not applicable

Re: Append JSON array into Object and send it from response

the only way I think is to take all the objects that are in the array and then insert them into the new object variable so that the response will recognize all the properties that are in the new object, but until now I still haven't managed to do that. This flow will run when the user from the powerapps application sends the data needed to hit the API and when the API sends a response, it will be returned back to poweapps.

Highlighted
Anonymous
Not applicable

Re: Append JSON array into Object and send it from response

I got the answer of my question above.

 

just need to give response body JSON schema into my Response and add body from parse output :

 

image.png

 

after that I can get all of the values in PA :

 

from my collectionfrom my collectioninto my dropdown buttoninto my dropdown button

 

Thanks everyone 🙂

View solution in original post

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (8,098)