cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User III
Super User III

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

Power Automate Video Tutorials

View solution in original post

Community Support
Community Support

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

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

Power Automate Video Tutorials

View solution in original post

Community Support
Community Support

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (8,438)