Post

#PowerPlatformTip 19: 'Resize files'

#PowerPlatformTip 19: 'Resize files'

TL;DR: SharePoint and OneDrive already create smaller versions of every image. In a flow, Get file thumbnail gives you that smaller version: the SharePoint action returns the image content directly, which you save with Create file; the OneDrive for Business action returns a URL, which you save with Upload file from URL. No premium connector, no image editor.

Need a smaller version of an image inside a flow, for an email, a report or a Power Apps gallery, without a premium image-processing connector or external editor? SharePoint and OneDrive render thumbnails for images anyway. Two standard actions turn them into a real file.

💡 Challenge

Photos from phones and cameras are several megabytes each. Attaching them to emails, embedding them in documents or loading them into an app is slow, and full image editing usually means extra tooling or a premium connector.

✅ Solution

Use the built-in Get file thumbnail action. It exists in both connectors, and both take a file and a Thumbnail Size:

  • SharePoint: Get file thumbnail returns the thumbnail content (binary). Write it straight into a new file with Create file.
  • OneDrive for Business: Get file thumbnail returns a thumbnail URL, valid for 6 hours. Upload file from URL saves it as a file in OneDrive.

🔧 How It’s Done

Route A: image in a SharePoint library

1. Identify the file.

🔸 Use a trigger such as When a file is created in a folder or an action such as Get file properties, so you have the file’s Identifier.

2. Get the thumbnail.

🔸 Add the SharePoint action Get file thumbnail: Site Address = your site, File Identifier = the identifier from step 1, Thumbnail Size = the size you need.

3. Save it.

🔸 Add Create file (SharePoint): Folder Path = for example /Shared Documents/Thumbnails, File Name = small_ plus the original name, File Content = the Thumbnail Content output of step 2.

Route B: image in OneDrive for Business

1. Get the thumbnail URL.

🔸 Add the OneDrive for Business action Get file thumbnail with the File and a Thumbnail Size.

2. Save it from the URL.

🔸 Add Upload file from URL: Source URL = the thumbnail’s URL from step 1, Destination File Path = for example /Thumbnails/small_photo.jpg, Overwrite = Yes.

🔸 Upload file from URL always reports success after 20 seconds, whatever the actual result. If later steps need the file, check that it exists first, for example with Get file metadata using path.

🎉 Result

Next to the original you get a smaller copy of the image, created by SharePoint or OneDrive, ready to attach, embed or show in an app.

🌟 Key Advantages

🔸 Standard actions only: SharePoint and OneDrive for Business, no premium connector.

🔸 No editor needed: the thumbnail service does the scaling and keeps the aspect ratio.

🔸 Fits into any flow: works per file in a trigger or in an Apply to each over a folder.

🎥 Video Tutorial

🛠️ FAQ

1. Which route should I take?

If the image is in a SharePoint library, take Route A: no URL detour, and the content goes straight into Create file. Route B is for files in a OneDrive.

2. Can I resize multiple images in one run?

Yes. List the files with Get files (properties only) and loop over them with Apply to each, one Get file thumbnail and one Create file per image.

3. Why is the OneDrive thumbnail URL useless the next day?

The URL returned by the OneDrive Get file thumbnail action is only valid for 6 hours. Save the file right away with Upload file from URL instead of storing the URL.

🔸 #PowerPlatformTip 18: ‘Download & Save Files’ - get the original file into SharePoint before you resize it.

🔸 #PowerPlatformTip 86: ‘Free Power Apps Icons’ - free, lightweight SVG assets for when you need graphics instead of resized photos.

This tip is by Marcel Lehmann, Microsoft MVP (Business Applications) and founder of the Power Platform Academy – live Power Platform workshops, free or CHF 49. Join the workshop waitlist to get notified about new dates. For companies that want this implemented for them, see KMUpower – Power Platform consulting & automation for SMEs (DACH).

This post is licensed under CC BY 4.0 by the author.

Microsoft and the Power Platform product names (for example Power Apps, Power Automate, Copilot Studio) are trademarks of the Microsoft group of companies. This is an independent website. It is not operated, sponsored or endorsed by Microsoft.