cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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!

 

Thanks,

 

Andee  

 

9 REPLIES 9
Highlighted
Kudo Kingpin
Kudo Kingpin

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

Highlighted
Solution Sage
Solution Sage

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

Highlighted
Frequent Visitor

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

 

 

Highlighted
Kudo Kingpin
Kudo Kingpin

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;

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.

 

Thanks,

Harry_G

Highlighted
Frequent Visitor

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

Highlighted
Kudo Kingpin
Kudo Kingpin

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  

Highlighted
Frequent Visitor

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
Regular Visitor

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.

 

Highlighted
New Member

Re: Renaming a File in SharePoint Online using Flow

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?

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

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

Users online (5,556)