How can I assign a unique number to the name column of a document set preferably with workflows? (Perhaps this number can increase by one each time a new document set is created)

When a user attempts to create a new document set, this unique number should be already there as the name of the document set. (However, It seems that access and edit the Name column is more tricky than the other columns)

1 Answer 1


You can set name in the NewForm using JavaScript, before item is created. If item is created, you need to move document set, not rename. When workflow is starting, item is already created.

You can add simple JavaScript and set Name field while NewForm is opened. SharePoint has possibility to execute JavaScript when "OK" button clicked, just add PreSaveAction JS function to the NewForm like this:

function PreSaveAction() {
  //set name value

If you need to increment document ids, you can use SPServices library to get last document id.

Another option is to create event receiver with ItemAdding handler, which will override document set name before it is saved.

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.