0

In SharePoint Online document library, if you create a new document using the "New" button, it will automatically name the new document "DocumentX.docs" (where X is the incrementing number appended to each document to keep it unique). For example, if you create 3 new documents in this way, you would end up with "Document1.docx", "Document2.docx" and "Document3.docx".

When you delete a document, it allows the "New" button to reuse the freed up document name. For example, if we deleted "Document3.docx", and clicked "New", it would create a new document, named "Document3.docx".

Now, in our environment we have set documents to be opened in the Desktop Application by default. This is because the document templates used by our customer get mangled in the Word Online editor.

The problem is that when users create a new document, which just happens to be re-using an older file's name (in the case of our previous "Document3.docx" example), the client application opens and then displays the message:

Refresh Recommended - A newer version of this file is available on the server:

enter image description here

We believe this occurs as the Desktop Application thinks it is opening the previously deleted document, based purely on the name alone.

The quick fix is to ask the user to click "Discard Changes". However, we are concerned this is going to be very confusing to our users, and we don't want them clicking "Save a Copy"; as this will open the Save As dialogue, and prompt them to then save locally (not wanted) or risk overwriting another valid document (definitely not wanted).

The question we have is: is it possible to set the default document name to something custom when clicking the "New" button in SharePoint, so that it can never be reused (for example, to add a date/timestamp by default)? If not possible, are there any other workarounds we can apply?

1 Answer 1

0

As a workaround, you could use Power Automate to rename files with timestamps. As shown in the sample below, you may need to add a delay step for the documents created in the browser. Because, Power Automate can't update a document's metadata when it's still open in the browser (it has to be closed).

Note: replace 'SP.Data.ExcelAItem' in the screenshot with 'SP.Data.' + [LibraryName] + 'Item'

enter image description here

Expressions

[Delay Until]

addMinutes(utcNow(),5)

[varTimeStamp]

convertFromUtc(utcNow(), 'Eastern Standard Time', 'MMddyyyyTHHmmss')

[SP API Uri] //use dynamic value as shown in the screenshot

_api/web/list/getbytitle('DocLibraryName')/items('ID') 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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