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 / Incremental rename files
Power Automate
Unanswered

Incremental rename files

(0) ShareShare
ReportReport
Posted on by 4

Hi the community,

I am trying to build a flow, so when I scan an invoice (in de onedrive app) that Power Automate renames the file based on the previous one.

For example: latest created, is named 'ACH 230057', it must name the new scanned file 'ACH 230058' and so on..

 

Thanks in advance!

Best 

Joao

 

Categories:
I have the same question (0)
  • Unknown geen idee Profile Picture
    1,757 on at

    Dear joaoseabra,

     

    This should be relatively simple, provided your files always have the same name structure.

    Suggest you include the following steps in your flow:

    1. Create variable "HighestNumber".
    2. Get all the files in the folder.
    3. Within an 'Apply to all' loop:
      1. Use compose action with split() to split the file names and get just the number.
      2. Create condition to save the output number from the compose action only if it is higher than the current variable number.
      3. Save the number as variable "HighestNumber".
    4. At the end of the loop the variable "HighestNumber" will have the highest number of the file names.
    5. Use a compose to do "HighestNumber" + 1 and use this output in the filename.
    6. Save the file.

     

    Hope this helps,

    Happy flowing,

    Koen

     

  • joaoseabra Profile Picture
    4 on at

    Hi Koen,

     

    Did not have time yet to check this out. Will check your steps tomorrow and let you know if it works.

     

    Best,

    Joao

     

  • grantjenkins Profile Picture
    11,063 Moderator on at

    @joaoseabra Will the flow be triggered when you create a new file in your folder (need to rename the file that was created), or do you create the file within the flow itself (set the name when you create the file)?

  • joaoseabra Profile Picture
    4 on at

    @grantjenkins Hi grantjenkins, flow needs to triggered when I scan an invoice, file is then created in onedrive (pdf) with name 'scan - XXXX' - see example attached. 

  • grantjenkins Profile Picture
    11,063 Moderator on at

    @joaoseabra Sorry for not getting back to you earlier. Do you still need help with this flow? If so, then I can see what I can do for you tomorrow.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard