Triggers & Actions
If you’re looking to get some more details on the triggers or actions available for Microsoft Teams, check out our documentation. You can select the respective “Triggers” or “Actions” items on the left-hand menu and browse each of the available options to see helpful descriptions and example inputs.
Important Notes
- It can take up to 90 seconds for a message entered in Microsoft Teams to be acknowledged or acted upon by the workflow in InsightConnect. If you’re not getting an immediate response, try waiting a little longer before troubleshooting.
- When using the “Add Member to Channel” action, the channel being used must be private. If the channel is not private, you may see a 400 Bad Request response.
- If the Teams plugin action that you’re using requires a team name as an input, make sure your team name is unique. If there are multiple of that team name in your environment, the correct one may not be used when the plugin carries out its actions.
Tips & Tricks
Pretty Messages
If you want to beautify the messages your workflow is posting to Microsoft Teams, check out the “Send HTML Message” action. You can do the following:
- Take a chunk of markdown that you have (say, from an InsightConnect artifact).
- Use the “Markdown to HTML” action from the Markdown plugin to convert it to HTML.
- Take the output of that plugin and use it in the “Send HTML Message” with Microsoft Teams. And bam! You have a lovely, readable message with a ton of good info. (This is courtesy of one of our fellow InsightConnect users!)
Regexes
The actions that offer use of regular expressions (like “Get Teams”) use Python-specific regexes. Check out https://regex101.com/ to test your regular expressions (and be sure to select Python as the “Flavor” on the left).
- If you want the commands you enter in Teams to be fairly flexible and user-friendly, try using
(?i)
in your regexes. This will start “case-insensitive mode” and make it so you don’t have to remember whether to capitalize certain pieces of your commands.
HTML Cleanup
There are cases where the content extracted from the body of a Teams message can contain HTML. This may result in subsequent steps failing to parse that content because of the HTML tags. To fix this, you can:
- Use the “Text” action from the HTML plugin to strip those tags and be left with the text content from the Teams message.
- We do this in workflows on the Extension Library so we can ensure all message content is good-to-go for parsing and other subsequent steps.
Got some questions about other Microsoft Teams actions, or some of your own tips & tricks you want to share? Feel free to post here!