cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DanielS1
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
v-bacao-msft
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

Expiscornovus
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
v-bacao-msft
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

Expiscornovus
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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (42,833)