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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Keeping a file's exten...
Power Automate
Suggested Answer

Keeping a file's extension when creating it from "Get File Content"

(0) ShareShare
ReportReport
Posted on by 4
Hi,

My flow starts with a Form through which users can provide attachments.
 
These attachments are automatically saved to a OneDrive folder, and my flow copy these on different Sharepoint folders through "Get File Content" [OneDrive] and "Create File" [SharePoint]. I use this opportunity to rename the file according to a specific nomenclature.
 
Does anyone know how to preserve the Extension of the original file?
 
Please keep in mind my level is that of a beginner.
 
Thanks!
Categories:
I have the same question (0)
  • CU08111613-0 Profile Picture
    14 on at
    Use this flow layout to preserve the file extension when renaming:

    Trigger: When a new response is submitted (Forms).

    Action: Get attachments.

    Action: Get file content (OneDrive).

    Compose: Extract the original file name.

    Compose: Extract file extension using split() and last()
    last(split(outputs('Compose_FileName'), '.'))

    Compose: Create the new filename by appending the extension
    concat('YourNewFileName_', utcNow(), '.', outputs('Compose_FileExtension'))

    Action: Create the file (SharePoint) with the new filename.

    This layout will keep the original file extension while applying a new name.
  • Suggested answer
    CFernandes Profile Picture
    8,402 Most Valuable Professional on at
    Hey Mate, Just use the expression below
     
    In Compose, this will give you the file extension - split(item()['name'],'.')[1]
     
     
     
    Full Solution - 

     
    Output
     
     
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
     
    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.
     
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at
    You might be interested in this YT Tutorial: How to Add Microsoft Form File Uploads to a SharePoint List Item
     
    Although this specific tutorial covers how to add a MS Form file upload to a SP list item, the concepts covered in this tutorial can be applied to your flow. If you get suck—upload screenshots of your flow in the Classic Designer (toggle off the New Designer) with all actions expanded (in Edit Mode).

    In this Microsoft Power Automate Tutorial I’m going to cover how to add file uploads to a SharePoint list item. First, I’ll show you how to get the file name and content from the File Uploads from your Microsoft Form, then I’ll show you how to add those files to a SharePoint item. 

    IN THIS VIDEO:
    ✓ Two types of MS Forms
    ✓ Where Microsoft Personal (OneDrive) Form File Uploads are Saved
    ✓ Where Microsoft Group Form File Uploads are Saved
    ✓ How to Add a File Upload Question to an MS Form
    ✓ How to get a Microsoft Form ID
    ✓ How to get a Microsoft Form Response
    ✓ How to Get the Dynamic Content Microsoft Form File Upload Content
    ✓ How to handle Single and Multiple Microsoft Form File Uploads
    ✓ How to use a Scope action to Organize and Group Your Flow Actions
    ✓ How to Get the File Content from an MS Form File Upload
    ✓ How to Collect All Files from Multiple File Upload Questions
    ✓ How to Handle MS Form Response When a File Isn’t Uploaded
    ✓ How to Attach an MS Form Single File Upload to a SharePoint List Item
    ✓ How to Attach Multiple MS Form File Uploads to a SharePoint List Item
    ✓ How to Attach MS Form File Uploads to an Email
     

     
    Hope this helps!

    Consider giving me a ❤️ if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram

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 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard