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 / Automatically (dyamica...
Power Automate
Unanswered

Automatically (dyamically) naming files which are saved into a folder

(0) ShareShare
ReportReport
Posted on by 2

Hi,

 

I have a situation where I'm extracting reports from an ERP system automatically, which are saved in a folder every hour.

 

I need to automatically change the name of each file entered into the folder as follows:

 

1. Include a serial number for each file name (file 1, file 2 etc.) with a new number being allocated to each new file saved in the folder

3. If possible, restart the numbering sequence each day (file 1 to file 24 for each hour of the day, and then start again at file 1 the next day)

2. Assign a date/time to each file name, based on the time it was saved in the folder

 

I'm a newbie to Power Automate so would really appreciate help in knowing if this is possible to do, and if so how it can be done.

 

Thanks!

I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    Hi @MalikMahamoor 

     

    Yes all of those actions are possible.

     

    1. Include a serial number for each file name (file 1, file 2 etc.) with a new number being allocated to each new file saved in the folder

     

    For this you will have to maintain the last updated number at some place lets say Excel.

    Something like this.

    VJR_0-1646822109629.png

     

    - Whenever you want to assign a new number to the file name, go and read cell B1 using "Read from Excel Worksheet".

    - then add 1 to it. 

    - Use this new number 4 to rename the file as File 4. 

    - then go and update cell B1 as 4 (for the next time to get the file number as 5).

     

     

    2. If possible, restart the numbering sequence each day (file 1 to file 24 for each hour of the day, and then start again at file 1 the next day)

     

    - If your cell value is 24 (after completing the previous day), then it means that you need to start from 1.

    - Another option is to check the time of the day when the Flow is scheduled for. If the current system time is at the beginning of your day then you can start from 1.

     

     

    3. Assign a date/time to each file name, based on the time it was saved in the folder

    When you do a "Get Files in folder", you will get a variable property as CreationTime. You can make use of that.

  • Guriga Profile Picture
    188 on at

    Guriga_2-1646929199120.png

    Hi,

     

    As you said the report saved in every hour so it can be the serial number.

    So it's easy.

  • MalikMahamoor Profile Picture
    2 on at

    Hey Guriga,

     

    Thanks for this, would you be able to open one of the steps to show me how it is entered?

    MalikMahamoor_0-1646939494621.png

    I've tried to replicate your flow but keep getting ' before and after created time/full name etc. which i noticed you havent.

     

    My flow then gives me an error that I need to select a Datetime for the argument to work.

     

    this is what i currently have which is incorrect.

    MalikMahamoor_1-1646939581278.png

     

     

  • VJR Profile Picture
    7,635 on at

    @MalikMahamoor 

     

    The error is because you have taken the Short Date format in line #4.

    Short Date format uses forward slash / and this character is not allowed to give as a file name.

    Refer sample section below.

     

    VJR_0-1646967594101.png

     

     

     

    You need to give an appropriate custom format.

     

    VJR_1-1646967679222.png

     

     

  • Guriga Profile Picture
    188 on at

    @MalikMahamoor  Here it is. You wrote the variable in the wrong format. That is the problem.

    Almost the same as @VJR did it.

     

    Guriga_0-1646986005277.png

     

    Guriga_1-1646986023734.png

     

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 246 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 176

#3
Haque Profile Picture

Haque 157

Last 30 days Overall leaderboard