cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Get Teams name and Teams Channel

Hi, 

 

I'm trying to use the "When a new channel message is added" trigger that works on a specified team sire and channel. When a message is added, the flow takes certain message values and creates a sharepoint item with them. That works fine. However, I'd like to also include the team name or ID and channel name or ID in the sharepoint item. The standard options in the flow don't include either, so I think I need to use an expression to return them. I have tried the following without success: 

string(triggerOutputs()?['webUrl'])
 
Does anyone know how I can extract:
- Team name or ID
- Channel or ID
 
And post it to the item column in sharepoint? 
2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support
Community Support

Hi @DanielS1 ,

 

Please try to use following expression to get Team ID and Channel ID.

Team ID:

first(split(last(split(triggerBody()['webUrl'],'groupId=')),'&tenantId'))

Channel ID:

replace(replace(last(split(first(split(triggerBody()['webUrl'],concat('/',triggerBody()?['etag']))),'message/')),'%3A',':'),'%40','@')

12.PNG

 

Best Regards,

Community Support Team _ Barry
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

Super User II
Super User II

Hi @DanielS1,

 

You should be able to use triggerbody()?['webUrl']. Can you test this expression?

 

triggerbodyweburl.png

View solution in original post

3 REPLIES 3
Community Support
Community Support

Hi @DanielS1 ,

 

Please try to use following expression to get Team ID and Channel ID.

Team ID:

first(split(last(split(triggerBody()['webUrl'],'groupId=')),'&tenantId'))

Channel ID:

replace(replace(last(split(first(split(triggerBody()['webUrl'],concat('/',triggerBody()?['etag']))),'message/')),'%3A',':'),'%40','@')

12.PNG

 

Best Regards,

Community Support Team _ Barry
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

Super User II
Super User II

Hi @DanielS1,

 

You should be able to use triggerbody()?['webUrl']. Can you test this expression?

 

triggerbodyweburl.png

View solution in original post

Thanks for the responses, both. This is perfect! 

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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
Users online (3,872)