Thursday, October 18, 2012

Append Created Date Column to Document Name using SharePoint Workflow

I recently had a request to change the names of documents in a document library based on a certain time interval. The requirement was to simply append the document creation date to the original name of the document, preceded with an underscore. To accomplish this need, you must first create a calculated column that converts the Created column format to a text format:

Next, create the Workflow using SharePoint Designer. In the drop-down list of Actions, select to Set Workflow Variable. Give the variable a name, and select the String Builder button. Add the Name column, not the Name (for use in forms) or Name (linked to document with edit menu) columns, type an underscore (_), and add the newly created calculated column for creation date.

Next, in the drop-down list of Actions, select to Set Field in Current Item. Set the field to the Name (for use in forms) column and the value to the variable source, which can be seen by selecting Workflow Variables and Parameters as the data source. Lastly, add logic to stop the Workflow.

Save and Publish the Workflow.

No comments:

Post a Comment