How to Post Image to Microsoft Teams Channel Using Power Automate?

In this tutorial, I will explain how to post image to Microsoft Teams channel using Power Automate.

How to Post Image to Microsoft Teams Channel Using Power Automate

To post an image to the Microsoft teams channel using Power Automate, follow the example below.

Scenario:

I have a SharePoint document library called ‘Customer Signatures.’ Whenever a file is created in that document library, I need to post that image to the Microsoft Teams [Marketing] team channel [Customer Signatures].

The screenshot below represents the SharePoint document library:

Power Automate Post Image to Microsoft Teams Channel

The below image shows the Microsoft Teams team channel:

Send an Image to MS Team Channel with Power Automate

Follow the below-mentioned steps:

1. Navigate to the Power Automate Home page, click + Create, and select ‘Automated cloud flow‘. In the next window, select the ‘When a file is created (properties only)‘ trigger, provide a flow name, and click the Create button.

Inside the trigger, provide the below details:

  • Site Address: Choose a SharePoint site address from drop-down.
  • Library Name: Select the Library name which is present in that particular site
How to send an Image to MS Teams team Channel with Power Automate

2. Then, add the ‘Get file properties‘ flow action. Provide the following details:

  • Site Address: Choose the site address we have taken in the trigger.
  • Library Name: Select a specific library name from the drop-down.
  • Id: Select Id from the dynamic content of the trigger.
How to post an image to Microsoft Teams channel using Power Automate

3. Next to that, add a ‘Compose‘ flow action to give the expression related to the height and width of an image.

  • Inputs: Insert the below code.
<img src="@{body('Get_file_properties')?['{Thumbnail}']?['Medium']}" width="100" height="100" alt="My Image">

You can also change the width and height of an image according to your requirements.

Post an image to Teams channel using Power Automate

4. After that, take a ‘Condition‘ control flow action. Provide the condition expression like below:

@body('Get_file_properties')?['{IsFolder}'] is equal to false
Microsoft Power Automate send an image to Microsoft Teams team channel

5. Now, select the ‘Post message in a chat or channel’ flow action‘ under true condition. Configure the below parameters:

  • Post as: Select the Flow bot option from the drop-down.
  • Post In: Choose the option Channel from the drop-down.
  • Team: Choose the team name.
  • Channel: Select a channel under the team.
  • Message: Provide the details of the message and select outputs of the compose that need to be sent.
Send Image on Microsoft team channel through Power Automate

6. Now, it’s time to save the flow. Click on the Save button. Then, select Test. Run the flow Manually. Click on Run flow.

See also  Power BI Measure IF with Examples

7. Now, create a file in the SharePoint document library, as shown in the below screenshot.

Power Automate Send Image on Microsoft team channel

8. When the flow runs successfully, it will post a created image in the Microsoft Teams team channel.

How to post an image to MS Teams team channel using Power Automate

This way, we can automatically send an image to the team channel of Microsoft Teams using Power Automate.

Conclusion

I hope this tutorial gives you an idea of how to post an image to the Microsoft Teams team channel from the SharePoint Online document library using Power Automate.

Also, you may like:

>