I'm trying to create a workflow in SharePoint Designer that will automatically rename files as they are created/uploaded in various document libraries, to a pre-determined 'item ID' pattern. The idea is that all the documents in one library might be called DOC-0001, DOC-0002, DOC-0003...
The information required to generate an ID for each library is stored in a list called ID prefixes, which contains the prefix (DOC- in this case), the length of the ID and the next available number. The GUID of the library is also stored to allow the workflow to look up the next available ID from a calculated column in the ID prefixes list.
In order to prevent errors occurring due to duplication I have a document in another library called Workflow Edit Tokens, which the workflow must check-out before issuing an item ID. I am using a SharePoint 2013 workflow so that multiple instances of the workflow will wait until this token is checked back in before proceeding. SharePoint 2010 workflows will fail with a 'cancelled' status if the token is already checked out, and if this isn't used at all the workflows will attempt to rename multiple files the same item ID.
The problem I'm having is that the only column I can save data to using a reusable workflow (there are many document libraries that will use this workflow) is Title. Name (filename) is not available, and hence I can't rename the files at all.
At the moment the only option I can see is to manually create the workflow for each document library. Can anyone suggest a way of changing the Name column from a SharePoint 2013 reusable workflow, or alternatively a way of queueing SharePoint 2010 workflows so conflicts don't occur?
Thanks, Jon