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 / Give new name to file ...
Power Automate
Unanswered

Give new name to file and add a date

(0) ShareShare
ReportReport
Posted on by 3

I've searched and tried on my own for quite a bit now and can get through, I'm a novice to this and I feel that I got the idea clear but cannot get it in action.

I'm trying to get all the photos from a folder and give a unique name for all of them, and then, add the creation date at the beginning.

I'm guessing I should use some sort of loop, so that the program gets the first image, name it let's say "Photo" and then add the date in front, before starting the same process for the next image. 

I already have the first part set up, where the program gets the images and assigns them a variable "FilesToRename", then I put a for each and inside the for each two rename files, the first to assign a new name, and the second to add the date at the begin. The first rename set to use the "CurrentFile" from the for each and giving a variable "RenamedFiles", and then the second rename takes the "RenamedFiles" but is not working.

Any input on how to set it up?

 

giofar_0-1672376202182.png

 

 

Kind Regards.

I have the same question (0)
  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    Hi @giofar 

    What is not working exactly here:

     

    and then the second rename takes the "RenamedFiles" but is not working.

     

     

    When you debug your code line by line, is %RenamedFiles% holding the files after action 8 is completed?

     

    Since you are executing renaming actions on a single %currentitem% - we know %renamedfiles% collection should contain 1 file only.  Did you try to call it directly by %renamedfiles[0]% in action 9 to see if it does any difference?

  • VJR Profile Picture
    7,635 on at

    Hi @giofar 

     

    The process is not working because in line #8 you have provided FiletoRename. So every file in that list is attempted to be renamed as Test_ and they cannot be rename because more than 1 file cannot have the same name.

    Either you can modify your process or change something as below.

    Left hand side is the output after running the flow.

    Wait time of 1 sec is added so that no two files have the same name (just in case it is so fast that two files are created within the same second).

     

    VJR_0-1672395871408.png

     

  • VJR Profile Picture
    7,635 on at

    And this is what you need to see

    VJR_0-1672396179538.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
11manish Profile Picture

11manish 233

#2
David_MA Profile Picture

David_MA 217 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 190

Last 30 days Overall leaderboard