cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Anonymous
Not applicable

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
edgonzales
Super User
Super User

@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.

Anonymous
Not applicable

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

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?

Anonymous
Not applicable

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.

Anonymous
Not applicable

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 🙂

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (1,625)