Hi all,
I'm trying to set up a flow that would respond to a new channel message that is posted in Microsoft Teams.
I set up the flow as follows:
Trigger -> When a new channel mesage is added
Flow Step-> Post a reply to a message
The Post a reply to a message requires the team name and channel, message ID, and then the reply you would like to post. Dynamic content is enabled on the reply, but not the message ID field, preventing me from auto replying to the message that was previously posted.
It works great sending an e-mail using dynamic content and a bunch of other workarounds, but this is frustrating that I can't just use dynamic content from step 1 to fill out the message ID field.
Solved! Go to Solution.
Hi @Anonymous ,
Please use Compose to input Message Id, then fill Compose's output in Message field.
Image reference:
Hope it helps.
Best Regards,
Hi @Anonymous ,
Please use Compose to input Message Id, then fill Compose's output in Message field.
Image reference:
Hope it helps.
Best Regards,
Thanks that does certainly help and has resolved this issue.
I have one more question for you if you can help further.
Does Flows have any sort of way of pulling message replies from a message in the teams channel? I believe Microsoft Graph API has a way of doing this, but requires admin privileges, if there is a way within flows that would greatly help.
Hi @Anonymous ,
Unfortunately, the action in Teams connector is currently unable to pull message replies from a message in the teams channel.
I am afraid there is currently no suitable way to achieve such a requirement.
If you want such a feature to be supported by MS Flow, please consider submitting your suggestions in Flow ideas forum:
https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas
Best Regards,
I've tried use the 'Post reply to a message' with no success. Here is what my Flow looks like, the trigger is 'When an item is created' the next connector is a condition then this:
The second yes option starts with another trigger 'When a new channel message is added' following the format given in this thread. I got the idea from here: https://powerusers.microsoft.com/t5/General-Flow-Discussion/Tips-Use-a-Trigger-in-middle-of-Microsof...
In any case the flow failed at the compose connector with this error message: "Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2624': 'The template language expression 'body('When_a_new_channel_message_is_added')?['id']' cannot be evaluated because property 'id' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'."
I'm now stuck.
Is it possible to use the "post a reply to a a message" connector without using the 'When a new channel message is added' trigger? My goal would be for the 'post a reply' to respond to the particular message generated by the flow, rather than any message in the channel - is this possible?
Thanks in advance!
@DataFailure Did you ever manage to find a solution to this problem? Having the same issue myself as I want to achieve almost the exact same situation - reply to a message I posted earlier in the Flow.
@JamesSnaps No I couldn't get it to work with the flow set up I had in my post. The reply would go to the next conversation/message added to the teams channel rather than the one generated by the flow.
Looking at that flow again I am wondering if setting the connectors up in the following way might work? Granted I have not tested this, it just popped into my head. This might have the reply ready to go so it would send when the post a message connector activates?
When a new channel message is added > Compose > Post reply to a message (V2) > Post a message (V3)
Edit:
I have now tried the above and couldn't get it to work. I'd forgotten that When a new channel message is added is a trigger rather than an action so it wont activate until a message is manually posted to teams. Here is the error I got:
Sorry I can't be of more help.
@DataFailure So I've managed to get this to work now. I had to place the compose (and the reply action) in an Apply to each following the 'when a new channel message is added' trigger. So my setup is basically the same as yours, but with that difference.
The message being replied to is initially posted in parallel to these actions, with a slight delay to give the trigger time to be ready.
Hello.
Do you know if how can I mention people this way, using this reply function?
I tried <at> syntaxis, without success