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
yashag2255
Dual Super User II
Dual Super User II

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 II
Super User II

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
yashag2255
Dual Super User II
Dual Super User II

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 II
Super User II

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

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

yashag2255
Dual Super User II
Dual Super User II

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 .

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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Users online (32,493)