When a record is updated, the workflow rule that is triggered by the update, can see the value of each column both before it was update and after it was update. 

This is possible because workflow rules are triggered when data is changed. As a result, the workflow rule can see both the before and after value of each column of the record that triggered the workflow rule.

Before Value

The Before value is captured just before a record is updated. It contains the field values obtained from the worksheet or database record just before the update is applied.

The Before value includes all virtual column values. The virtual column values are recomputed when the Before value is retrieved. This ensures that the virtual column values reflect the most current field values.

The Before value may not be the same record value that was present on the client device when it made the update. If you have two or more client devices, the following situation can arise:

  1. Client device 1 reads the record.
  2. Client device 2 reads the same record.
  3. Client device 2 updates its copy of the record and syncs its update to the server.
  4. Client device 1 updates its copy of the record and syncs its update to the server.

In this case, the Before value for the update synced by Client device 1, will contain the changes made by Client device 2. This is rarely a problem, but you should be aware that it can occur.

After Value

The After value is captured just after a record is updated. It contains the field values obtained from the worksheet or database record just after the update is applied.

The After value includes all virtual column values. The virtual column values are recomputed when the After value is retrieved. This ensures that the virtual column values reflect the most current field values.

If the workflow rule invokes any Data Change Actions, the effects of these Data Change Actions are not reflected in the After value. The After value only reflects the changes made by the update that triggered the workflow rule. However, the effects of all Data Change Actions are reflected in the current field value. In summary:

  1. You can compare the Before and After values to see the changes made by the update that triggered the workflow rule.
  2. You can compare the Before and current [FieldName] values to see all changes including both the update that triggered the workflow rule and all subsequent Data Change Actions.

Using the Before and After Values

You can use the Before and After values in the following ways:

  1. You can display the Before and After values in the Body template and Attachment template.
  2. You can display the Before and After values in the Body, Subject, PreHeader, From Display, and Attachment Name.
  3. You can use the Before and After values in <<If>> expressions in the Body template and Attachment template. This allows you to conditionally include or exclude portions of the template depending on the Before and After values.
  4. You can use the Before and After values in the workflow rule's IF THIS IS TRUE expression to control whether the workflow rule is triggered. This is often used to trigger a workflow rule when a field's value is changed, or is changed to a specific value.

Limitations

Your workflow rule can only see the Before and After values of the record that triggered the workflow rule. You cannot see the Before and After values for the child records of the updated record. 

This limitation exists because we perform each record update independently. For example, if you update a parent record and one of it's child records, we perform two independent updates. One update affects the parent record. A second independent update affects the child record. The workflow rule invoked when the parent record is updated, cannot not see the Before and After values of the child record update. 

If you define a workflow rule for the child record, it can see the Before and After values of the child record that triggered the rule. However, it cannot see the Before and After values of it's parent record.

Display the Before Value of a Column

When a record is updated, you can display the Before value of a column. For example, to display the Before value of the Priority column in your workflow template:

The old value of the Priority columns was <<[_THISROW_BEFORE].[Priority]>>

Display the After Value of a Column

When a record is updated, you can display the After value of a column. For example, to display the After value of the Priority column in your workflow template.

The new value of Priority is <<[_THISROW_AFTER].[Priority]>>

Display the Before and After Values of a Column

You can display both the Before and After values of a column to show how the column's value has changed. For example, your workflow template can include:

The old Priority value was <<[_THISROW_BEFORE].[Priority]>> and the new Priority value is << [_THISROW_AFTER].[Priority]>>

Compare the Before and After Values of a Column

You can compare the Before and After values of a column to determine if the column's value has changed. For example, you can trigger a Change workflow rule when the Before and After value of the Priority column has changed by specifying a workflow rule Condition property:

[_THISROW_BEFORE].[Priority] <> [_THISROW_AFTER].[Priority]

Check for Specific Before or After Values

You can check for specific Before or After values. For example, you can trigger a Change workflow rule when the After value of the Priority column is High by specifying a workflow rule Condition property:

AND([_THISROW_AFTER].[Priority] = "High", [_THISROW_BEFORE].[Priority] <> [_THISROW_AFTER].[Priority])
Did this answer your question?