cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GuttormG
Frequent Visitor

Get data from JSON

I have a flow that gets new posts from Teams. I use triggerBody() to extract the data, and pase this to JSON. So far so, good 🙂
Now I want to get only a few values from this JSON. How do I get the values marked in this JSON?

I have tried things like outputs('Parse_JSON')?['sections']?['facts'] in several different ways, but either the flow fails, or I get a null-value.

Any suggestions?

 

GuttormG_0-1642770950202.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

Since Sections and facts are both arrays you'll need to add an index number to reach them directly.  Something like this

outputs('Parse_JSON')?['sections'][0]?['facts'][0]?['value'] 

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
Pstork1
Dual Super User
Dual Super User

Since Sections and facts are both arrays you'll need to add an index number to reach them directly.  Something like this

outputs('Parse_JSON')?['sections'][0]?['facts'][0]?['value'] 

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
GuttormG
Frequent Visitor

Ahh, thank you very much! Got almost crazy of all the brackets, question marks and index numbers I couldn't figure out. 
Also, I had to use body() instead of outputs(). Don't know why, but it works now!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,778)