web
You’re offline. This is a read only version of the page.
close
Skip to main content
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,181 Most Valuable Professional on at
    Re: .gif file on Sharepoint -> MS Teams

    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
    Re: .gif file on Sharepoint -> MS Teams

    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,181 Most Valuable Professional on at
    Re: .gif file on Sharepoint -> MS Teams

    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
    Re: .gif file on Sharepoint -> MS Teams

    Sadly my gif got 418KB... 😄 

     

    I think i'll upload them

     

  • Expiscornovus Profile Picture
    33,181 Most Valuable Professional on at
    Re: .gif file on Sharepoint -> MS Teams

    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard