cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

changing certain words in a sp file name to upper case

Hi,

 

I have about 200+ files uploaded in a document library. All the file names for respective files in SharePoint follow upper/lower format. So each word in a file name has first alphabet set in upper case and remaining alphabets in lower, same goes for other words in file name. A sample file name is as follows: Monthly Cfo Mm Budgeting Llc 1-29-19. I had achived this sort of file naming convention via a flow running on a document library, pelase see screenshots. 

Scr1.PNGScr2.PNGScr3.PNGScr4.PNGscr5.PNG

 

 

The above flow works without an issue but i have anohter challenge.

Now the requirement is if a file name contains words like: Cfo, Mm and Llc then they should be changed to upper case :CFO, MM, LLC. If a file name does not contain such words then will remain as is. I believe this would be possible to do, I will have to setup a separate flow as I already ran the above flow on a document library so if someone can assist, it will be a big help. I guess there will be formula changes in my existing flow.

 

P.S: This operation is required for all the existing documents, not looking to automate when a file is created/uploaded, thanks in advance.

2 REPLIES 2
mydevexperience
Helper I
Helper I

Hi @Anonymous,

 

You have two tasks to do:

(1) Existing document names to rename to capital letters depending on the condition.

(2) When a new file is copied to a library then rename to captial letters if it meets the criteria.

 

For task 1 you need flow step SharePoint Get Items. Then within the apply each loop check the condition something like below to add a function (fx).

@contains(items('Apply_to_each')?[toLower('{FilenameWithExtension}')], 'cfo') contains 'cfo'.

 

If yes then copy the file to a new location with new filename with captial letters. Delete the current file. Then move the newly created file to the old location.

 

Let me know how it goes.

 

Thanks

 

 

For task 2 you could use similar logic but the event you could use is when a file is created (SharePoint). I haven't tested this yet.

 

Thanks

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,468)