cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
COlsch
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
abm
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 blogPower Automate Video Tutorials

View solution in original post

v-alzhan-msft
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
abm
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 blogPower Automate Video Tutorials

View solution in original post

v-alzhan-msft
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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (3,906)