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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Saving Attachments but...
Power Automate
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.

Categories:
  • SanmeshG Profile Picture
    1,956 Moderator on at

    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

  • ID-23071600-0 Profile Picture
    18 on at

    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 

  • ID-23071600-0 Profile Picture
    18 on at

    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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 432

#2
11manish Profile Picture

11manish 313 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 154

Last 30 days Overall leaderboard