cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
andeeh1974
Level: Powered On

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!

 

Thanks,

 

Andee  

 

8 REPLIES 8
Harry_G
Level 8

Re: Renaming a File in SharePoint Online using Flow

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

Capture.JPG

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

Capture.JPG

 

After creating file just delete the old one.

Capture.JPG

 

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

 

Thanks.

 

Regards,

Harry_G

v-zhos-msft
Level 10

Re: Renaming a File in SharePoint Online using Flow

Hi andeeh1974,

Harry_G have provided a complete solition.

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

1.png2.png

Please feel free post back if you need more help.

Best regards,

Zhonys

akh0123456789
Level: Powered On

Re: Renaming a File in SharePoint Online using Flow

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?

 

Thanks,

Andee

 

 

Harry_G
Level 8

Re: Renaming a File in SharePoint Online using Flow

hi @akh0123456789,

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

PLease see images below;

1.JPGClick on Photo2.JPGChoose File3.JPGClick on done

 

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

 

Thanks,

Harry_G

andeeh1974
Level: Powered On

Re: Renaming a File in SharePoint Online using Flow

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

 

 flow1.JPG

flow2.JPG

flow3.JPG

Thanks in advance!

Andee

Harry_G
Level 8

Re: Renaming a File in SharePoint Online using Flow

@andeeh1974,

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? 

 

Thanks,

Harry_G  

akh0123456789
Level: Powered On

Re: Renaming a File in SharePoint Online using Flow

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).    

Highlighted
mnoorgat
Level: Powered On

Re: Renaming a File in SharePoint Online using Flow

I think you may find this article helpful.

 

https://powerusers.microsoft.com/t5/Building-Flows/Renaming-a-File-in-SharePoint-Online/td-p/176708

 

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.

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,600)