SharePoint Online specific.

I wanted to know if it is possible to enforce file naming conventions at the folder or sub-folder level in a Document Library.

For example, I have a Document library called "Documents" with many sub-folders. I want to enforce a specific file naming convention for all Word (docx) files uploaded to a "Legal" folder, e.g. "Document_Name_Department_MMYYYY".

Then similarly a different file naming convention in the folder "IT", etc.

I have found a site that explains how to do it using the CSOM (https://www.tatvasoft.com.au/blog/how-to-implement-remote-event-receiver-in-sharepoint-online/).

Is anyone aware if this is possible using JS, no-code, Azure or Flow? basically an alternative way rather then the CSOM example listed above.



You can use SharePoint Designer Workflow or Microsoft Flow to update filenames on creation, but it’s not much of an enforcement.

Please see the post below.

How to give naming convention for a document library.


How about just adding Departement as a metadata field on the library? If needed you can inject that value into the doc as a quick part. Enforcing a naming conversion is a huge can of worms, so user training and monitoring often is better way than a technical solution

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.