
Announcements
Hi!
I'm pretty new to Power Automate Desktop and am trying to rename all the pdf files in a folder to the first 15 characters of their current name.
I tried -
Get files in folder that match '*' and store them into Files
Get subtext of Files starting at character 0 with length 27 and store it into Subtext (the 27 includes the folder path)
Rename file(s) Files to Subtext and store them into List RenamedFiles
The Files variable correctly contains all the files from the folder, but my problem is that the Subtext only gets the first file. How can I rename all the files in the folder to the first 15 characters of their name + file extension? Am I on the right track?
Thanks so much!
Liz
- Use the Get file path part action to get only the file name. Save this in a variable lets say OriginalName
- And then do a Subtext
The Subtext variable will now have the 15 chars of the string. You need to take care of validation in case the original name is not more than 15 chars.
- Then do the rename using the original name and the new name.
- Since this will be inside the loop it should do this for all the files.
Post back if you are facing any issues.