Teams Trigger parsing

For anyone who uses Microsoft Teams I wanted to pass on something I found to hopefully save you some troubleshooting time.

When using the Microsoft Teams Plugin as a Trigger the {{[Teams].[message].[body].[content]}} would show up as a string when a user types it, but if they copy and past into the chat it comes in as HTML. So if you are using a Pattern Match step and have a ^ for start of line or $ for end it doesn’t match.

The fix for this is using the HTML plugin with the Text Action to strip an HTML string of all tags and return only the text. I found that the resulting text had new lines at the beginning and end of the Teams message that was still breaking my Pattern Match, so I added an Advance Regex in between with a search and replace of (^[\r?\n]|[\r?\n]$) to strip off the beginning and ending new lines.

Using these two Steps have become the standard for any Workflow with a Microsoft Teams Trigger.
Hopefully I saved you some of my headaches.

5 Likes

@brandon_mcclure Thank you for sharing this trick! This is awesome!!

Tagging a few member on my team so we have visibility :slight_smile:

@jon_schipp @mike_rinehart @joey_mcadams

Also going to link this post here -> Microsoft Teams Plugin so other customers can see this when they view the plugin page under ‘Discussions’