Create a Workflow that Fires when a Value Changes
Despite three generations of SharePoint Designer Workflows, you still have to use a trick to get a workflow to fire when something changes to something else (e.g. someone changes the value in an Item Status column from ‘Draft’ to ‘Submitted’).
Note: This post assumes you have some knowledge of creating workflows in SharePoint Designer.
Imagine you have a Change Request list that needs a workflow that does the following:
- If the Change Request Status column in the item is set to ‘For Action’, you want the person specified as the Assignee to be notified (via email) that they have an item they need to action
- If the Change Request Status column in the item is set to ‘For Review’, you want the person specified as the Approver to be notified (via email) that they have an item they need to review and either Approve or send back for Rework
- If the Approver sets the Change Request Status column to ‘Rework’, you want the item Assignee to be notified of same and the reasons that the Approver gave.
- If the Approver sets the Change Request Status column to ‘Approved’, you want the item Assignee to be notified of same.
The problem is that out-of-the-box SharePoint Designer workflows can only fire if something is equal to or is not equal to something else (yes there are other triggers, but not relevant ones). There is no trigger that allows you to say ‘if something changes to something else, then do this’.
If you have the workflow fire when the item is set to ‘For Review’, it will do so every time the item is edited, which basically means that people will start ignoring your notification emails.
To get the workflow to fire only when something changes to something specific, you need to add a hidden column. You set your workflow to run if the value in the hidden column is not equal to the column you are tracking and then get the workflow to update the hidden column to the same as the column you want the workflow to run off!
So, let’s say I have a Change Request Status choice column in my list with the below values:
- For Analysis
- For Action
- For Review
- Approved and Completed
I add a text column called Change Request Hidden and hide the column by enabling the management of content types.
I crack open SharePoint Designer and create the below workflow! The last step is very important – it’s the one where you update the hidden column to be the same as the choice column you want to trigger the workflow.
Next time, I will explain how to include a link to the specific item in the notifications emails described above – this is another thing that is not as easy as you would expect!