5 Post to Teams From a Workflow Shared by Michael Allen, Valorous Church 7 months ago 12.0 Communications, General, Workflow Intermediate Our staff is trying to move to using Microsoft Teams for internal communication instead of email. As we are making this move, we wanted to make sure that Rock wasn't contributing to the email overload in everyone's inbox. To help with this, we set up a utility workflow that can make a post into a Teams channel. Setup Teams Before we can post into a channel, we have to generate a webhook for that channel. Open the team and channel that you want to post to Select "..." > "Workflows" Search for "Webhook" and select the template "Post to a channel when a webhook request is received" Click through the dialog box until the last screen where you are given a webhook URL. Copy that as we will need it later when sending a message. Rock I have created a utility workflow to make posting messages easier. Download the workflow export that is attached to this recipe. Navigate to "Admin Tools > Power Tools > Workflow Import/Export" to import the workflow Take note of the WorkfowTypeId for use later If you implemented an earlier verison of this recipe that used the webhook connector, you will need to re-download the workflow export since there were several changes to make it work with Power Automate workflows. Using the Workflow Basic (text-only) In its most basic form, the workflow will post a text-only message. All that is required for this is passing in the webhook you copied earlier, and the text you want to send. {% workflowactivate workflowtype:'123' webhook:'YourWebhookHere' text:'Hello world!' %}{% endworkflowactivate %} Advanced (Templated Card) Adaptive cards allow you much more flexibility than simple text. You can include formatting, images, and even action buttons that can link back to Rock. The workflow includes an adaptive card template that we commonly use. You can also design your own custom template and pass that into the workflow to post. To use the included card template, you can pass in the following parameters. (All parameters are optional unless specified) Title: The title on the card FromPerson: This person's photo and name will show on the card [required] Subtitle: Smaller text under the person's name BodyText: Paragraph text that will display above the facts table Facts: A set of key-value pairs that will show in a table on the card. (key1^value1|key2^value2) Actions: A set of key-value pairs that describe the buttons for the card. (text1^url1|text2^url2) {% raw %}{% workflowactivate workflowtype:'123' webhook:'YourWebhookHere' title:'Hello world!' fromperson:'{{ CurrentPerson.PrimaryAlias.Guid }}' subtitle:'This is a test' bodytext:'Lorem ipsum dolor sit amit...' facts:'foo^bar|baz^qux' actions:'RockRMS^https://rockrms.com' %}{% endworkflowactivate %}{% endraw %} Custom Adaptive Card If you want to design your own template, you can use Microsoft's adaptive card designer. The designer provides a WYSIWYG template designer and provides you with the JSON template. To post your custom card, you can call the workflow and pass in the template in the card parameter. {% raw %}{% capture cardTemplate -%} Paste your card template here {%- endcapture %} {% workflowactivate workflowtype:'123' webhook:'YourWebhookHere' card:'{{ cardTemplate }}' %}{% endworkflowactivate %}{% endraw %} Change Log 2024-08-05 - Updated instructions and workflow export to reflect MS depricating connectors in favor of workflows 2024-04-25 - Initial Version Download File