cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vbvbvb
Microsoft
Microsoft

HTTP request to Azure AD - removing text from body output after Graph query

Hi all, would appreciate any ideas on this:

 

            {

  "value": [
    {
      "id""aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee"
    }
  ]
}
 
Is there an easy way to extract./transform that output to retain only "id" value itself? In this case : "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee". Thanks!
2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @vbvbvb 

 

Yes. Can you share a screenshot of your flow setup so far? 

 

After the http action, you can add a Parse JSON action and in that pass the body of the HTTp action output and for the schema, select generate from sample payload and paste the outputs returned in the http action from a previous run to generate the schema. Add a compose action after that and you should be able to see the id as a part of the dynamic content. 

 

Hope this Helps!

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!

View solution in original post

fchopo
Super User
Super User

Hello @vbvbvb 

You could use "Parse JSON" action. Have a look at this sample:

parseJson.png

 1) In the "Parse Json" action, you could generate the schema from a sample payload (the json code you showed).

2) After that, we can read the Id value and store it in variable.

 

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

View solution in original post

6 REPLIES 6

Hi @vbvbvb 

 

Yes. Can you share a screenshot of your flow setup so far? 

 

After the http action, you can add a Parse JSON action and in that pass the body of the HTTp action output and for the schema, select generate from sample payload and paste the outputs returned in the http action from a previous run to generate the schema. Add a compose action after that and you should be able to see the id as a part of the dynamic content. 

 

Hope this Helps!

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!

fchopo
Super User
Super User

Hello @vbvbvb 

You could use "Parse JSON" action. Have a look at this sample:

parseJson.png

 1) In the "Parse Json" action, you could generate the schema from a sample payload (the json code you showed).

2) After that, we can read the Id value and store it in variable.

 

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Thanks, this looks very useful - but quick question, how did you managed to use Initalise Variable inside Apply to each control?

Hi @vbvbvb 

 

You cannot use intialize variable in the apply to each. The flow was not saved in the screenshot and I believe was just to show how to access the required item. 

 

Hope this Helps!

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!

Ok, it makes sense now - Parse JSON does break each value down into  dynamic value. Great stuff, thanks @fchopo and @yashag2255 .

alrez
Community Support
Community Support

Hi,

 

It looks like you were able to resolve your issue from a few very helpful suggestions from our community. There is a great article below; if you would like to learn more on Json's.

 

https://spmaestro.com/handling-json-in-microsoft-flow/

 

Regards,

 

Alex

 

-------

 

Community Support Team _ Alex Rezac
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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,650)