cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
COlsch
Level: Powered On

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

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!



View solution in original post

Community Support Team
Community Support Team

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

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!



View solution in original post

Community Support Team
Community Support Team

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

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

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!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (5,413)