
The **Send Channel Message** node lets you create a workflow for sending notifications to your team members in a Microsoft Teams channel. For example, you may send notifications immediately after a deviation occurs in your workspace.

## Prerequisites
---
1. Go to Power Automate to create [a workflow from a channel in Teams](https://support.microsoft.com/en-us/office/creating-a-workflow-from-a-channel-in-teams-242eb8f2-f328-45be-b81f-9817b51a5f0e). Save workflow to generate incoming webhook URL. 
2. Edit the created workflow by filling out the **TeamId** and **ChannelId** fields. These values will be suggested. If not:
    - To get the value of **TeamId**, go to the MS Teams application and retrieve a link to the team. **TeamId** is the part of generated URL groupId=XXXX. 
    - To get the value of **ChannelId**, go to the MS Teams application and retrieve a link to the channel. **ChannelId** is a part of generated URL channel/XXXXXXXX. 
3. Save the changes in the workflow.  
4. If you want to send an interactive message (such message can contain links, simple surveys, sections), prepare it in [AdaptiveCard](https://adaptivecards.io/designer/).

#### Recommended

Optionally, you can test the integration by posting a request to the webhook URL generated as a part of prerequisites. Body of the request must be as follows:  
    

<pre><code class="language-json">{
  "type": "message",
  "attachments": [
    {
      "contentType": "application/vnd.microsoft.card.adaptive",
      "contentUrl": null,
      "content": { // your AdaptiveCard goes here
        "type": "AdaptiveCard",
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "version": "1.3" // webhook integrations support only 1.3 version!
      }
    }
  ]
}</code></pre>



## Node configuration
--- 


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Fields marked with the <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/snippet-icon.png" alt="Snippet icon" class="icon" > icon accept [snippets](/docs/assets/snippets) or [inserts](/developers/inserts). This integration allows usage of profile-related inserts.

</div></div></div>


1. Click the node.  
2. On the pop-up, click **Create connection**.  
3. In the **Incoming webhook URL** field, enter the webhook you created [earlier](#prerequisites).
3. Click **Next**.  
4. In the **Connection name** field, enter the name for the connection you created. 
5. Click **Apply**.  
    **Result**: A connection is created and selected.   

    <figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/ms-teams-node.png" class="large" alt="Blank node configuration form"><figcaption>Blank node configuration form</figcaption></figure>

4. From the **Type of message** dropdown list, select the type of the message you want to create:  
    - **Simple text message** - Choosing this option lets you write a plain text.
    - **Interactive message (JSON)** - Choosing this option lets you build messages with sections, buttons, links, simple surveys.
5. Follow the scenario according to the message type you selected:
    - If you selected the Simple message option:
        1. In the **Text of message** field, enter the text you want to include in the message.
    - If you selected the Interactive message (JSON) option:  
        1. In the **JSON body of message** field, enter the structure of the message you have prepared in AdaptiveCard as a part of prerequisites.

6. Confirm by clicking **Apply**.  
  **Result**: When the Send Channel Message node is executed, a [`MSteams.sendChannelMessage` event](/docs/assets/events/event-reference/integration#msteamssendchannelmessage) event is generated on the activity list of the profile who is the actor in the workflow.

### Test integration
---

You can run a test request. If the request body contains a dynamic reference to a profile attribute and/or an event data from preceding nodes, then you can define the context using [test profile data](/docs/settings/configuration/test-profiles). 


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Complete description of the feature is available in [Testing outgoing integrations](/docs/automation/test-requests-for-outgoing-integrations).

</div></div></div>



1. In the **Test integration** section, click **Send test request**.  
    **Result**: A test request builder opens. If:
    - a request body contains dynamic references, the request preview appears after you select the context of test profiles and events.
    - a request body contains static data, the preview of the body request appears immediately.
    <figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/test-request-builder-empty.png" class="large" alt="An empty test request builder"><figcaption>An empty test request builder</figcaption></figure>
2. If your request contains dynamic references (otherwise, the options aren't available):   
    - From the **Test profile** dropdown, select a test profile in the context of whom the test request will be performed.  
    - From the **Event context** dropdown list, you can select a particular occurrence of an event  whose values/information will be used for the test request.  
        1. Select a test profile.  
            **Result**: A history of test profile events appears.  
            <figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/event-stream-test-profile.png" class="large" alt="A stream of events of a test profile"><figcaption>A stream of events of a test profile</figcaption></figure> 
        2. From the list of events, select one whose data you want use as a context. If there is no event you can use, in the upper-right corner of the pop-up, click **Define own event** and provide the body of the event.
        3. Confirm by clicking **Apply**. 
3. Verify the request body. If there is something you want to change, come back to the node settings from previous steps.  
3. If the request body is ready to test, in the upper-right corner, click **Send request**.  
    **Result**: The response section appears and the **Update response event** button becomes active.  
4. Optionally, you can update response event with new parameters by clicking **Update response event** in the upper-right corner.

## Example of use
--- 
For example of use, refer to our [Send an alert to Microsoft Teams channel use case](/use-cases/teams-integration).