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 / saving a SharePoint li...
Power Automate
Unanswered

saving a SharePoint library document thumbnail to an image file

(0) ShareShare
ReportReport
Posted on by

How can I save a thumbnail generated for a document in a SharePoint library to another library in SharePoint? I'm stuck on converting the automatically generated thumbnail into a file (e.g. jpg). 

I've tried using the URL (i.e. _layouts/15/getpreview.ashx?path=) but I'm not sure how to extract the content from what is generated at that URL. I've also tried variations on @{binary(outputs('Get_file_properties')?['body/{Thumbnail}/Large'])}.

My original flow uses a workaround where I copy from SharePoint to OneDrive because there is a simple Get File Thumbnail action for OneDrive in Power Automate, but that is problematic with other users.

Thanks in advance 🙂

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    on at
    Re: saving a SharePoint library document thumbnail to an image file

    Hi @_nerdy ,

     

    I did a simple demo for you.

    vxiaochenmsft_0-1630914885904.png

    vxiaochenmsft_1-1630914905983.png

    _layouts/15/getpreview.ashx?path=@{outputs('Get_file_properties')?['body/{FullPath}']}

     

    vxiaochenmsft_2-1630914933470.png

    base64ToBinary(outputs('Send_an_HTTP_request_to_SharePoint')?['body/$content'])

     

    Best Regards,

    Wearsky

     

     

  • SF-30110036-0 Profile Picture
    on at
    Re: saving a SharePoint library document thumbnail to an image file

    Hi @v-xiaochen-msft. Perfect. You made that look easy 🙂 I appreciate you taking the time to help out!

  • steve_hendy Profile Picture
    385 on at
    Re: saving a SharePoint library document thumbnail to an image file

    https://blog.vitalyzhukov.ru/en/sharepoint-online-document-thumbnail

  • SamuelBenjamin Profile Picture
    70 on at
    Re: saving a SharePoint library document thumbnail to an image file

    Hi, just trying this, but getting back a 501 Bad Gateway error in my flow.

    This is how my http request looks like:


    If I just try this url on the browser, a get back a invalid response error.

    Is there any additional setting to be made in my site or anything else I'm missing?

    Thanks so much in advance!
  • steve_hendy Profile Picture
    385 on at
    Re: saving a SharePoint library document thumbnail to an image file

    The path is not full.

  • steve_hendy Profile Picture
    385 on at
    Re: saving a SharePoint library document thumbnail to an image file

    Try this SharePoint Online. Document Thumbnail (vitalyzhukov.ru)

  • SamuelBenjamin Profile Picture
    70 on at
    Re: saving a SharePoint library document thumbnail to an image file

    So it won't work for video files? Any way to get a video file thumbnail?


    I just need to insert the video thumbnail into an email body. It does works with this:

    <img src=@{triggerOutputs()?['body/{Thumbnail}/Medium']}>

     

    But the issue is that this will work for some time, if you open the mail a few hours, the image won't be shown. I gues it's because the Thumbnail value uses temporary token.

  • SamuelBenjamin Profile Picture
    70 on at
    Re: saving a SharePoint library document thumbnail to an image file

    Oh, mp4 is not included on supported types for my tenant. I will ask IT to include this.

    Thank you so much for your support!

  • SamuelBenjamin Profile Picture
    70 on at
    Re: saving a SharePoint library document thumbnail to an image file

    Seems that mp4 files thumbnails are no longer supported. I have open a ticket to Microsoft and they asked me for a recent screenshot of any site showing the mp4 extension available within supportedtypes action... Kinda stupid thing!

  • Youngbin Profile Picture
    2 on at
    Re: saving a SharePoint library document thumbnail to an image file

    Can I ask you one thing? I followed your demo and it works only when there is no image in my powerpoint file.

    When there is an inserted image file, the create file at the end is that image file, not the preview image of the powerpoint page. Do you know why it's happening?

     

    Youngbin_0-1661101936002.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