How to copy all images and attachments in Ms Teams Channel Message body then save to specific folder in Sharepoint.
thank you so much
does that mean the image in the Body cannot be copied to the specified sharepoint folder?
Hi @wachid ,
Because the image in the clipboard is not recognized as an attachment, it is just an image inserted into the body of the text.
I recommend that you save the image locally and insert it as an attachment into the body of the Teams Channel.
Best Regards,
Sunshine Gu
Hi @wachid
I have a sample flow for you.
1. Create an automate flow & choose the trigger as 'When a new channel message is added'. Set the team & channel as per your need:
2. Next, add "Apply to each" action to iterate the attachments in the message. Pass the 'Message attachments' from the dynamic content as shown below:
3. Now, inside apply to each block add 'Get files (properties only)' action. In the site URL set the teams site where message is sent. Similarly, set the source team channel folder in 'Limit Entries to Folder' where messages are being posted:
In the above action, set:
Site Address: <source team site url where messages are being posted>
Library Name: Documents
Limit Entries to Folder: <source channel folder where messages are being posted>
Filter Query: FileLeafRef eq '@{items('Apply_to_each')?['name']}'
Next, add another "Apply to each" action and pass the value object from get files to it:
Inside "Apply to each 2" action, add copy file action to copy the attachment to desired folder:
Set the source site URL & document library of the team site where messages are being posted. Set the destination site & folder as per your need.
If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.
Thanks
Hi @wachid ,
In MS Teams, if you upload files or pictures, they will be automatically saved to the dedicated SharePoint folder of the Teams Channel, so we need to get the paths of these files and then save them to the specific folder of SharePoint.
I did a test for your reference.
In my scenario:
items('Apply_to_each')['name']
My Teams Channel:
Files automatically saved to this Teams channel:
Save files in specific folder:
Best Regards,
Sunshine Gu
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492