cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sreedwilson
Frequent Visitor

Link to a specific message in Teams

I am building a Flow that will notify a user if a certain hashtag is used.  I have the Flow working properly - but I cannot seem to figure out if there is a way to link to the specific message.  I am sending the notification to their mobile device.  I don't see an action that includes a link to the Teams message - but wondering if this could be built in some way using expressions? Or perhaps some other method?

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

Hi @sreedwilson,

 

Currently MS Teams connector does not provide a viable feature to get the link to the message.

If you want to the feature that you mentioned to be supported in Microsoft Flow, please submit an idea to Flow Ideas Forum:

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

In addition to this there is a method that could be considered for use.

Each message in Teams has a unique link, copying their link, we will find that they are actually spliced, many parts are the same, only the Message id is different, this could be obtained through Flow.

You could copy the links of several messages of the same channel to observe their similarities and differences.

I did a test on my side, using Message id to divide a link into three parts, put them in the compose, and then use the Concat() function to add Message id, thus forming the url of the message.

You need to copy the link of a message in your own channel, and then take the three parts in a similar way.

Expression:

 

concat(outputs('Compose'),triggerBody()?['id'],outputs('Compose_2'),triggerBody()?['id'],outputs('Compose_3'),triggerBody()?['id'])

Image reference:

18.PNG

Please take a try and let me know if you have any issue.

 

Best Regards,

Barry

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

4 REPLIES 4
v-bacao-msft
Community Support
Community Support

Hi @sreedwilson,

 

Currently MS Teams connector does not provide a viable feature to get the link to the message.

If you want to the feature that you mentioned to be supported in Microsoft Flow, please submit an idea to Flow Ideas Forum:

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

In addition to this there is a method that could be considered for use.

Each message in Teams has a unique link, copying their link, we will find that they are actually spliced, many parts are the same, only the Message id is different, this could be obtained through Flow.

You could copy the links of several messages of the same channel to observe their similarities and differences.

I did a test on my side, using Message id to divide a link into three parts, put them in the compose, and then use the Concat() function to add Message id, thus forming the url of the message.

You need to copy the link of a message in your own channel, and then take the three parts in a similar way.

Expression:

 

concat(outputs('Compose'),triggerBody()?['id'],outputs('Compose_2'),triggerBody()?['id'],outputs('Compose_3'),triggerBody()?['id'])

Image reference:

18.PNG

Please take a try and let me know if you have any issue.

 

Best Regards,

Barry

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

Thanks Barry!

Hi @v-bacao-msft. I tried your solution exactly as your screenshot ("when a new channel message is added", 4 composes, "post a reply to a message").

 

It didn't work for me somehow. It seems like

triggerBody()?['id']

did not get the message id becaue the input and output of the last compose are the same, id wasn't inserted. It failed at the last step of post a reply and got a 400 bad request "Resource not found for the segment 'teams.microsoft.com'."

 

Any idea what may caused this?

 

Update: I found the solution in another thread that compose can get the message id as a dynamic content. I wonder why it only works with compose not other actions where a messge id is needed.

mancku
New Member

Hi,

 

As per today is as easy as using the expression triggerBody()?['webUrl'] if the flow is triggered when a new message is added, or item('...')['webUrl'] if we're getting the item any other way. The important part here is that the property webUrl will get you the link to that specific message

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

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

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (31,151)