cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
drangga17
Level: Powered On

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
drangga17
Level: Powered On

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 :

 

image.pngfrom my collectionimage.pnginto my dropdown button

 

Thanks everyone Smiley Happy

5 REPLIES 5
Super User
Super User

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

@drangga17 

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.

drangga17
Level: Powered On

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

Super User
Super User

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?

drangga17
Level: Powered On

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.

drangga17
Level: Powered On

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 :

 

image.pngfrom my collectionimage.pnginto my dropdown button

 

Thanks everyone Smiley Happy

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 420 members 4,608 guests
Please welcome our newest community members: