cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mrpowergage
Resolver I
Resolver I

Post image to private teams channel

I'm unsuccessfully trying to post an image to a private teams channel using power automate.

 

I have the image as both a sharepoint link and as base 64, I can't get either to work.

 

I can embed an image as html in a teams message, but not the sharepoint image.

 

I can't get base 64 to work ie <img src="data&colon;image/png;base64, /9j/4AAQSkZJRgABAQ....

 

I don't think I can use an adaptive card because it is a private channel.

 

Any ideas / solutions welcome. thanks

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
mrpowergage
Resolver I
Resolver I

I managed to work round this by creating a file in onedrive, then getting a thumbnail for the file and using the URL in the Post Message to Teams action

View solution in original post

8 REPLIES 8
v-litu-msft
Community Support
Community Support

Hi @mrpowergage,

 

Unfortunately, post a message to Microsoft Teams with an image is not supported in Flow by now, there is an idea of it already created in the IDEA forum, you can head to vote it, collect votes to make it come true in the future:

https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Post-a-message-with-a-photo-to-Microsoft-Te...

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mrpowergage
Resolver I
Resolver I

I managed to work round this by creating a file in onedrive, then getting a thumbnail for the file and using the URL in the Post Message to Teams action

View solution in original post

Can you make a quick tutorial how exactly you solved this?


I think there is a number of people (including me) who would be very grateful for this.

To post a picture in teams is an often requested feature missing in flows atm.

 

Would be really appreciated!

marcosfromeroey
Regular Visitor

I managed to post a Sharepoint image in a Teams channel. But after a day or two, the image is no more available. Don't know why. Here are the steps for a scheduled flow:

1. Reccurrence

2. List folder (Sharepoint) to get a specific folder of a sharepoint site.

  1. Site address
  2. Folder with images

3. Get file metadata using path (Sharepoint):

  1. Site address
  2. File path dynamically calculated with this expression: gets a random path from all the paths in the folder of step 2 above:

 

outputs('List_folder')?['body'][rand(0, length(outputs('List_folder')?['body']))]['Path']

 

 

4. Get file properties (Sharepoint):

  1. Site address
  2. Library
  3. ItemId (from step 3 above).

5. Post a message (V3) (Teams):

  1. Team
  2. Channel
  3. Message (HTML):  <img src="[Thumbnail Large]"> (where [Thumbnail Large] is from step 4 above)

 

@mrpowergage 

Can you make a quick tutorial how exactly you solved this?


I think there is a number of people (including me) who would be very grateful for this.

To post a picture in teams is an often requested feature missing in flows atm.

 

Would be really appreciated!

This is the approach I used.

 

The limitation is that the Thumbnail URL generated expires after 6 hours, so it only shows in teams for that initial period.

 

Process I used is:

1) Upload to a temp location on onedrive

2) Get the thumbnail from the new file

3) Set the thumbnail as the source for an image in the teams message.

Screenshot 2020-12-21 at 19.30.50.png

 

Hope this is helpful.

GirishD
Frequent Visitor

@mrpowergage

 

i am using the same approach

 

I am saving the images in sharepoint folder and the power flow will post image into teams as soon as a new image is saves in sharepoint folder and the thumbnail is expiring in few hours.

 

is there any way to set the expiration to Thumbnail URL..like i need Thumbnail URL to be available for 30 days

 

please help

Hi @GirishD ,

 

Not simply. You can extract the base64, but teams doesn't have a way to display it. You could save it as an image file I'm sure and preserve it that way. Could be worth looking at the Cloudmersive or Experian services also.

Good luck, and let me know if you find anything, I could do with preserving for longer.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,944)