cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrittanyR
Helper III
Helper III

Read body data coming back from HTTP action

I am trying to find anything in the documentation when googling for this but unable to find any. I know it must be simple but, how do I read a specific value returned in JSON from the response body resulting from HTTP action? I got back the result successfully in HTTP action but I want to get only 1 value there and store it in a variable. 

1 ACCEPTED SOLUTION

Accepted Solutions
Jronash
Impactful Individual
Impactful Individual

If I'm understanding your question correctly, you should also be able to reference the value by using an expression like this:

body('HTTP_Action_name_here')?['body_element_name_here']

Without seeing your flow, I can't guess exactly what the expression would be, but hopefully you can fill in the gaps.

View solution in original post

2 REPLIES 2
yashkamdar
Solution Sage
Solution Sage

Hello Team,

 

Here is what you need to do after the Send an HTTP request action -

 

 Initialize Variable for storing the parsed ID (that we are going to do in the next steps) - 

  • Add ‘Initialize Variable‘ action to initialize a variable of type, ‘String’ and name it ‘ID’
 

yashkamdar_3-1599773247332.png

 

 

 

 

 

 

 

 

Parse JSON to Save the ID from the JSON - 

  • For the ‘Content‘ in the image below, navigate to ‘Add Dynamic Content‘ line and choose the ‘Body‘ option inside the ‘Send an HTTP request to SharePoint‘ action.
  • For the Schema, paste the body of Get HTTP request. You will get this from the run history.

 

 
 

 

yashkamdar_4-1599773264437.png

 

 

 

 

 

 Apply to each

  • For the ‘Select an output from previous steps‘ in the image below, navigate to ‘Add Dynamic content‘ line and choose ‘Value‘ inside the ‘Parse JSON‘ action.
  • Then, add a ‘Set Variable‘ action and for the ‘Name‘, select ‘ID‘ from the drop down menu and for ‘Value’, navigate to the ‘Add Dynamic content’ line, and choose ‘ID’ inside the ‘ParseJSON‘ action.

 

yashkamdar_5-1599773276864.png

 

Let me share a video tutorial on my youtube channel that will help you understand this very easily.

 

Video tutorial - https://www.youtube.com/watch?v=VT20p_LBU28

 

Navigate to 14 minutes and 39 seconds over here, where I have done exactly the same thing that you want. Only thing is I am grabbing a different entity. You can grab ID by referring the same URL.

 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Jronash
Impactful Individual
Impactful Individual

If I'm understanding your question correctly, you should also be able to reference the value by using an expression like this:

body('HTTP_Action_name_here')?['body_element_name_here']

Without seeing your flow, I can't guess exactly what the expression would be, but hopefully you can fill in the gaps.

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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,283)