Home >Tips >SharePoint Workflows > Reusable workflow to set title kalmstrom.com site map icon Site map  

Reusable Workflow to Set Title

A SharePoint Workflows tutorial by Peter Kalmström

SharePoint Designer iconIn the previous article we explained why it is important that the Title fields in list and library items are filled out, and we showed how to create a list workflow that sets the title to the same as the item's name. That workflow only works for one library. If you want to set the title to the same as the name in another library, you have to re-create the workflow for that library.

Another option is to create a reusable workflow, also called a workflow template. In the demo below Peter Kalmström, CEO and Systems Designer of kalmstrom.com Business Solutions, shows how to create a reusable workflow that sets the title to the same as the name of the list item or file not only for one library but for all libraries in the site collection.

You have to create a SharePoint 2010 workflow, because SharePoint 2013 workflows cannot be connected to a specific content type, which is necessary for this workflow.

Create a reusable workflow that sets the title to the same as the name

  1. Open the root site of the site collection in SharePoint Designer 2013.
  2. Click on the Workflows link in the left panel.
  3. Click on the Reusable Workflow button in the ribbon.
  4. Create a new SharePoint 2010 workflow and give it a name. Connect the workflow to the Document content type.
  5. Select the Condition to 'If current item field equals value' and set it to Title 'not equals' Name.
  6. Select the Action 'Set Field in Current Item' and set the Field to Title and the Value to Name.
  7. Do not set any start options. Here you can only disable the workflow. Instead you will set the start options when you associate the workflow with the content type.
  8. Publish the workflow

Associate the workflow with the Document content type

  1. Open the Site settings in the root site of the site collection and click on the Site content types link in the Web Designer Galleries group.
  2. Select the Document Content Types and then click on the Document content type.
  3. Click on the Workflow settings link and then on Add a workflow.
  4. Select the reusable workflow  you just created.
  5. Give the workflow a name and set it to start when an item is created or changed.
Now all the site collection's existing and new libraries  that use the Document content type (which is the default content type for libraries) will have this workflow.

Run the workflow on existing files

As the workflow is run at change or creation, existing files that are not touched will still be without a title. A quick way to make the workflow run on existing files is to create a dummy column and set a dummy value that changes the metadata of all files.
  1. Create a new column in the library.
  2. Modify the view to show the Title column and the new column.
  3. Open the library in Quick Edit mode and set a value in the first cell in the new column.
  4. Drag the value down to all documents. (If you have many documents in the library, you should open it in Access and work with it there instead.)
  5. When the workflow has run and all the titles are there, remove the dummy column again.

Follow kalmstrom.com on LinkedInFacebook or Twitter!

back icon next icon
Products Buy FAQ Services Tips Books Contact About Us Tools

Security and integrity

Copyright  Kalmstrom Enterprises AB  All rights reserved