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:
The below image shows the Microsoft Teams team channel:
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
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.
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.
4. After that, take a ‘Condition‘ control flow action. Provide the condition expression like below:
@body('Get_file_properties')?['{IsFolder}'] is equal to false
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.
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.
7. Now, create a file in the SharePoint document library, as shown in the below screenshot.
8. When the flow runs successfully, it will post a created image in the Microsoft Teams team channel.
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:
- Send a Message When a New Post is added in Microsoft Teams Team Channel in Power Automate
- Power Automate Remove Characters From String
- Reverse an Array in Power Automate
- How to Use Microsoft Copilot in Power Automate
- Set Microsoft Teams Status Using Power Automate
- Post an Adaptive Card to Microsoft Teams Using Power Automate
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.