A SharePoint Workflows tutorial by Peter Kalmström
When
you want to protect a name or another column value in a
SharePoint list or library, you can let a workflow react
to any changes and roll back the value to the original one.
In the demo below Peter Kalmström, CEO and Systems Designer
of kalmstrom.com Business Solutions, shows how to create
a Department content type, connect it to a new list app
and protect the Department name column from changes with
a rollback workflow. To achieve that, he first has to create
a workflow that sets the original Department name for each
item.
In his example, Peter uses a Departments list where the
name of each department must not be changed. For the workflows
he creates a separate column for the original name. This
column should be hidden to users.
This workflow idea can of course also be used for other
change reactions.
Set original name
We assume that the Department name entered when a new item
is created is the one that should be protected. So, if the
item is new, the name should be considered the original
one.
Create a list workflow for the Departments list.
Go to the end of the workflow if you use the SharePoint
2013 platform.
Set the workflow to start when an item is created.
Add the action,Update List Item? and set the value
in the 'Original Department Name ' column to be the
same as in,Department Name.
Check, publish and test the workflow.
Roll back name changes
When an item has been changed, the workflow must compare
the Department name with the original one and decide if
it the same or not.
If the values are not the same, the workflow must update
the list so that the value in the Department Name??? column
becomes the same as in the Original Department Name??? column.
Create a list workflow for the Departments list.
Go to the end of the workflow if you use the SharePoint
2013 platform.
Set the workflow to start when an item is changed.
Add the condition 'If any value equals value': If
?Original Department Name? not equals,Department Name.
If the condition is true, add the action,Update
List Item? and set,Department Name? to,Original Department
Name.