Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Saving Attachments but changing the filename

(0) ShareShare
ReportReport
Posted on by 18

I get daily emails that have three files attached from each of ten businesses in our group. I currently save these to folders in SharePoint using a flow for each business. Each admin has decided to name the files to their preference, and whilst I could ask them to change them, if I can make this happen with a flow, I'll have local control moving forward as I develop the process.

 

I'd like to save the attachments with a more common naming convention for example, the businesses send files that look like this

 

Business1_AdminStats.txt

Business2Admins.csv

Business3Administrators.csv

 

All three files are CSV files despite the extension being different in some cases, I'd like to save them like this:

 

Business1_AdminStats.txt --> Business1_Admins.csv

Business2Admins.csv --> Business2_Admins.csv

Business3Administrators.csv --> Business3_Admins.csv

 

Presently I save all the attachments and then copy, save and delete the files (three time per flow one for each file). That cant be the most efficient way.

  • ID-23071600-0 Profile Picture
    18 on at
    Re: Saving Attachments but changing the filename

    I've had a look at this and it doesn't achieve what I require, I think you misunderstood the objective. It uses the original filename and changes the extension which is not what I am attempting.

     

    I need to change the the filename and extension but based on the original name for example:

     

    Business1_AdminStats.txt changes to  Business1_Admins.csv (name and extension changes)

    Business2Admins.csv changes to Business2_Admins.csv (name changes, extension is the same)

    Business3Administrators.csv changes to Business3_Admins.csv (name changes, extension is the same)

     

    in your example, there is no method to match the original name so I know what to put into the new name.

     

    thanks for responding though, I have still learnt about variables and using them rename things

  • ID-23071600-0 Profile Picture
    18 on at
    Re: Saving Attachments but changing the filename

    thanks ... its not quite what I am doing

     

     

    I am doing this in SharePoint rather than OneDrive

    I need to change the filename and sometimes the file extension

     

    if the rename attachment action is available in SharePoint this may still work, I'll have a look but it wont be until tomorrow evening now.

     

    Thanks 

  • SanmeshG Profile Picture
    1,947 Super User 2025 Season 1 on at
    Re: Saving Attachments but changing the filename

    Hi @iandavies  ,

     

    Based on the question it looks like you want to save all the files as txt files(including the ones that are received as csv).

     

    In that case you can split the filename based on the file extension and add .txt and pass the new name instead of the actual attachment name in the create file one drive action.

     

    See if the below one helps,

    S1.png

     

    If this answers your question  , please give this a thumbs up and mark this as an answer.

     

    Thanks,
    Sanmesh

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >