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

Parse JSON output

I have JSON objects return from HTTP request. Sample object:

{

"meta": {

"somedata": "value"

}

"group": [

{

            "name": "myname",
            "url": "https://somesortofurl.com/914765"

},

{

            "name": "myname2",
            "url": "https://somesortofurl.com/9147644"

}

]

}

 

I want to create a 1) for each loop to extract only url from all the objects  2) and also the numeric values from the url so left(value,6). I will use the numeric value to create another http request. 

 

I tried For Each also tried to do it by compose using something like trigger()['group']['url'] but can't get this to work.  Any guidance would be much appreciated

 

3 REPLIES 3
Community Support Team
Community Support Team

Re: Parse JSON output

Hi @smerchant,

 

Have you tried the parse JSON action?

Parse JSON messages

 

Besides, you should be able to reference the trigger output through:

TriggerBody()?['group']?['url']

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
smerchant
Level: Powered On

Re: Parse JSON output

Thanks for a response @v-micsh-msft.  I indeed have used JSON Parse.  How should I add TriggerBody in the expression is it like TriggreBody('ParseOutput')?['server_list']?['url']?

 

 

Here are some screenshots

 

 

Output received from the JSON Parse

 Screenshot_8.png

 

Flow Screenshot

 

 

 flow.png

 

Error:

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@body('HTTP')' is of type 'String'. The result must be a valid array.

 

smerchant
Level: Powered On

Re: Parse JSON output

@v-micsh-msft please could you help?  Thanks,

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us 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: 131 members 4,495 guests
Please welcome our newest community members: