Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Renaming a File in SharePoint Online using Flow

I am new to Microsoft Flow and don't have a programming / developer background.   I have a SharePoint Online library which is getting a file copied using Content Organizer Rules.  What I want to do is simply rename the file using the metadata the file already has.  


The file comes over like this:  20190120000020B269FDocument1.pdf


Every file has the following metadata:  Title, First Name, Last Name, Full Name, Date Recieved 


What I'd like to do is rename the file to Title - Date Recieved.pdf .


I would like to know what steps I'll need to accomplish this.  I can't seem to find a SharePoint Rename action.....


Any help is much appreciated!






Kudo Kingpin
Kudo Kingpin

please flow the following steps to update the file meta data.


However if you want to rename the file name you have to create a copy of file and remove previous one.



After creating file just delete the old one.



If you find this helpful Please mark it as a Solution.






Solution Sage
Solution Sage

Hi andeeh1974,

Harry_G have provided a complete solition.

I have made a flow for your scenario, please check it for a reference.


Please feel free post back if you need more help.

Best regards,


Hi again, 


It took me a while to get back to this.  I'm trying to add images of my flow here but I'm not sure how to do that. 


I have three attachments....can you please advise me on how to add them to this particular thread?






hi @akh0123456789,

goto Reply -> Click on Photo Icon -> Choose File -> click on Done .

PLease see images below;

Click on PhotoClick on PhotoChoose FileChoose FileClick on doneClick on done


If this Answer is helpful, please mark it as a solution. So other will find it helpful.




Here is what I have created for our library.  What I want to do is basically:  when a file is created in the folder, check the file name, if it is in the right format, then do nothing.  Otherwise, change the name using the metadata but keep the file in place.  Here is my concat line info:  concat(variables('varTitle'),'-',variables('varDateRecieved'))


My flow gives me an error saying "Actions in this flow may result in an infinite trigger loop. Please ensure you add appropriate conditional checks to prevent this flow from triggering itself."  


I also tried using the "When a file is created or modified (properties only) trigger.  


When I test this, it does not do anything.  I am at a loss.  Help!  Please





Thanks in advance!



I think issue occured due to triggering flow on creation of file. Your flow also have a action which creates file so flow will start automatically again and again. however in next run your flow not creates the new file if name matches the format but May be there is any kind of check by MS for this scenario. Kindly check your flow by deleting the create file action and check the error, is still occured or not? 




I don't think I really understand the purpose of deleting my create file action?  How would deleting that actually be helpful to me?  The purpose of my flow is to essentially rename a file and keep all existing metadata and file properties except for the name.  I only want to have this triggered when a file is created in the library that doesn't follow the given format.  Then I want to delete the original named file so I don't have two files (and keep the correctly named file).    

I think you may find this article helpful.


I've used it to rename a file - creating a copy and deleting it is not a great idea if you want to retain version histories.


Hello everyone, thanks everyone for your ideas / help !!

I have the same requirement to "rename the files" and I encounter the problem that if I delete and create a copy, I lose the data of who originally created the file.
can that information be kept?
New Member

Why on earth do you need 5 boxes to rename a file???


Why can't there just be a 'rename' action?



@akh0123456789 wrote:

The purpose of my flow is to essentially rename a file and keep all existing metadata and file properties except for the name.     

So much this!

Helpful resources

Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,463)