cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

How to parse the response header & put a certain value of it into a variable

Dear community,

How to parse within Microsoft Power Automate the following new Teams ID "877b280d-0fb4-4a58-96a7-687067874970" and put it into a variable.

 

Source of the above mentioned Teams ID would be the Response-Header after successfully cloning a team within "Power Automate".

 

Response-Header (values have been altered)

----

cache-control: private
client-request-id: 4fb4559f-c558-4154-9ffb-26525293ef78
content-length: 0
content-type: text/plain
location: /teams('877b280d-0fb4-4a58-96a7-687067874970')/operations('0125456d-ae7e-450e-a454-355a79c2aa05')
request-id: 4fb5549f-c544-4144-9xygb-26425873ef88

----

 

Thanks in advance,
Chris

 

P.S.: I know how to get the "location" value with "outputs('http-post-action-xyz')['headers']?['location']". But I don't know how to get the Teams ID within the brackets out of it.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

Re: How to parse the response header & put a certain value of it into a variable

Hi @COlsch 

 

Add a compose action and use a split expression like below:

 

replace(replace(replace(split(outputs('http-post-action-xyz')['headers']?['location'],'/')[1],'teams(',''),')',''),'''','')

 

Thanks

 

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

View solution in original post

Highlighted
Community Support
Community Support

Re: How to parse the response header & put a certain value of it into a variable

Hi @COlsch ,

 

Please take a try with expression below:

substring(last(split(first(split(outputs('http-post-action-xyz')['headers']?['location'],')/operations')),'/teams(')),1,sub(length(last(split(first(split(outputs('http-post-action-xyz')['headers']?['location'],')/operations')),'/teams('))),2))

 

Best regards,

Alice       

 

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

View solution in original post

2 REPLIES 2
Highlighted
Super User III
Super User III

Re: How to parse the response header & put a certain value of it into a variable

Hi @COlsch 

 

Add a compose action and use a split expression like below:

 

replace(replace(replace(split(outputs('http-post-action-xyz')['headers']?['location'],'/')[1],'teams(',''),')',''),'''','')

 

Thanks

 

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

View solution in original post

Highlighted
Community Support
Community Support

Re: How to parse the response header & put a certain value of it into a variable

Hi @COlsch ,

 

Please take a try with expression below:

substring(last(split(first(split(outputs('http-post-action-xyz')['headers']?['location'],')/operations')),'/teams(')),1,sub(length(last(split(first(split(outputs('http-post-action-xyz')['headers']?['location'],')/operations')),'/teams('))),2))

 

Best regards,

Alice       

 

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

View solution in original post

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (6,975)