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 / Create a separate file...
Power Automate
Unanswered

Create a separate file while saving attachments

(0) ShareShare
ReportReport
Posted on by 10

Hello,

 

I have created a flow which saves a file from a particular mail every day successfully to my share point folder. However, the file is always replaced by the new file ( since all the files coming from this mail have the same name). I want them to be saved with a new file name instead of replacing the old file. e.g. the file come is abc.xls. The flow should save the file which comes the next day by the name abc1.xls and then the next day abc2.xls and so on instead of replacing the first file.

 

Note: I have already disabled versioning.

 

can anybody help me!!!

Categories:
I have the same question (0)
  • jdoss Profile Picture
    458 on at

    You can get the number of items in the folder (List Folder SharePoint action), then get the count of them (use compose with expression length([outputs of list folder])) then add that +1 to the file name. So if there are 5 files in the folder the new file would be abc6.xls

  • AbhijitP Profile Picture
    10 on at

    As I have mentioned, my file comes from the outlook and overwrites the existing file as the attachment in the mail always has the same name. What option should I try so that the file is not overwritten and new file is created with another name. Like abc1.xls and so on.

  • jdoss Profile Picture
    458 on at

    Well you can use the option I mentioned, or what I typically do is use the guid() function and create a unique code. Just get the file name while parsing and change it and add the guid to the file name. More specifically the substring(guid(), 0, 😎 with the last number being how long you want the id to be. Without seeing that part of your flow it's hard to help.

  • AbhijitP Profile Picture
    10 on at

    0B91A018-D386-4C42-92B9-ECDD8C31B409.jpeg

  • jdoss Profile Picture
    458 on at

    What happens in the condition? Are you saving the file somewhere or just getting the attachment? 

  • AbhijitP Profile Picture
    10 on at

    8F26DBFE-6B6B-4056-A247-F81A9D07FA64.jpeg

  • jdoss Profile Picture
    458 on at

    In that create file function instead of putting attachments name, put whatever you would like, since it is always the same you can use the guid(), see image. If you want to get the filename you can use the compose and a function to get the filename and attach a guid to it.name.png

  • v-jefferni Profile Picture
    on at

    Hi @AbhijitP ,

     

    Since you will have the file stored in SP folder everyday (one file for one day I guess), you can also create a variable to store current date as text and format as "yyyyMMdd" and append the date along with the file name, so you could conveniently find the file in other days.

    vjefferni_0-1642054473666.png

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • AbhijitP Profile Picture
    10 on at

    Where do I put the Initialise variable so that it would be helpful to me??

  • AbhijitP Profile Picture
    10 on at

    I tried this too but it did not halo the file is still being overwritten.

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

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard