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 / Rename new files in a ...
Power Automate
Answered

Rename new files in a sharepoint folder adding ascending numerical order

(0) ShareShare
ReportReport
Posted on by

Hello,

I need help creating a flow to rename new files from a specific sharepoint folder online, I need this flow to act whenever a file is created or moved to the folder, it needs to keep the original name of the file plus an ascending numerical order.

 

Example:

New file created in the folder called "archive_test.pdf"

The function should rename the file to "00001 - archive_test.pdf"

Categories:
I have the same question (0)
  • Verified answer
    v-mingkz-msft Profile Picture
    Microsoft Employee on at

    Hi @rnadolny,

    Do you want to rename file when a new file created in sharepoint library?

    I did some test according to your requirements.

    Please try:

    vmingkzmsft_1-1690438643868.png

     

    Get the last but one file in order of Created desc.

    vmingkzmsft_2-1690438775359.png

    The condition formula is:

     

    length(last(outputs('Get_files_(properties_only)')?['body/value']))

     

    vmingkzmsft_3-1690438830254.png

    Compose3:

     

    last(outputs('Get_files_(properties_only)')?['body/value'])?['{Name}']

     

    Compose4:

     

    formatNumber(add(int(substring(outputs('Compose_3'),0,5)),1),'D5')

     

    You cannot rename the file directly so you need to get file content and create a new file and delete the old one.

    vmingkzmsft_4-1690438940987.png

     

    Best Regards,

    Kyrie

     

     

     

     

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 274 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 175

#3
Haque Profile Picture

Haque 166

Last 30 days Overall leaderboard