web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / .gif file on Sharepoin...
Power Automate
Unanswered

.gif file on Sharepoint -> MS Teams

(0) ShareShare
ReportReport
Posted on by 160

Hi,

 

i want to post a .gif file, which i saved on Sharepoint, in a MS Teams message. Can someone check my flow and tell me what iam doing wrong? (The excel flow before the flow i show you is not relevant in this case)

 

wshalex123_0-1666693121244.png

Note: In the screenshot i tried to post the picture through direct link and the cariable formula

Formula:  variables('GIFFILE') [rand(0, length(variables('GIFFILE')))]

 

Output:

wshalex123_1-1666693205156.png

 

Thanks for your help 🙂 

 

 

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,851 Most Valuable Professional on at

    Hi @wshalex123,

     

    I would use a slash to close the IMG tag and I would also add a sub function to remove the last item in the rand function. Otherwise it could try and collect [2] which is item number 3. Which does not exist.

     

    Btw, I think I can reproduce your behaviour with SPO hosted gifs. Gifs from the internet seem to work fine.

     

    Try:

    <img src="@{variables('GIFFILE')[rand(0, sub(length(variables('GIFFILE')), 1))]}" />

     

    gifs_posted.png

  • wshalex123 Profile Picture
    160 on at

    Hello @Expiscornovus,

     

    yes, online gifs work just fine. I created custom gifs for employee jubilees. If possible i want not to upload them somewhere...

    variables('GIFFILE') [rand(0, sub(length(variables('GIFFILE')),1))]

     

    Sadly your solution does not work for me...

     
     
    wshalex123_0-1666700915697.png

     

     

     

     

  • Expiscornovus Profile Picture
    33,851 Most Valuable Professional on at

    Hi @wshalex123,

     

    As a workaround you might be able to use the base64 encoded gif. However, I don't know if these gifs are below the 28 kb?

     

    <img src="data:@{body('Get_file_content_using_path')['$content-type']};base64,@{body('Get_file_content_using_path')['$content']} " />

     

    getfilecontent_base64.png

  • wshalex123 Profile Picture
    160 on at

    Sadly my gif got 418KB... 😄 

     

    I think i'll upload them

     

  • Expiscornovus Profile Picture
    33,851 Most Valuable Professional on at

    Hi @wshalex123,

     

    FYI, I also tried the Graph API, found an unsupported content-type limitation message for image/gif in the HostedContents property:

    https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http#example-5-send-inline-images-along-with-the-message

     

     

    inlineimages.png

     

    Error message

     

    hostedcontent.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 607

#2
Valantis Profile Picture

Valantis 495

#3
Vish WR Profile Picture

Vish WR 429

Last 30 days Overall leaderboard