Crow Canyon Software Forum

Forum Navigation
Please or Register to create posts and topics.

Getting before and after change values for a column

We can set a condition to execute a workflow when a column changes by using afterchange:[[Any]]. Is there a way to get the values for beforechange: and afterchange: to use later in the workflow?

Thank you.

Hi Art,

You can use the "Get Column Value for Version" function in the Workflow to get the previous and latest values of a column and store them in a variable. Please refer to this article for more details https://www.crowcanyon.help/article/708/

That article says, "Function ‘getcolumnvalueforversion’ can be used to get the column value for a version enabled multiple lines of text column." The column I need the before and after values is a choice column.

For example, if I add a Gateway control and test "ItemStatus", it properly displays the "Before value" and "After value" (Pending and Approved respectively):
=================
Begin action execution ...
=================
Action Title: Before Pending
Action Type: Gateway
Condition information:
-----------------
Column name: "ItemStatus"
Condition operator: "Equal"
Condition value expression: "Pending"
Comparison Type: "Before Change"
-----------------
Condition evaluation information:
-----------------
Before Value: "Pending"
After Value: "Approved"
Condition evaluation information:
-----------------
Column value: "Pending"
Operator: "Equal"
Condition evaluated value: "Pending"
-----------------
Result: true
-----------------
Conditions evaluation result: true
Conditions matched: "true"
Successfully Executed

 

--- I'm trying to determine if I can capture "Before value" and "After value" for further processing, including adding to an email.

Thank you!

Hi Art,

"Function ‘getcolumnvalueforversion’ can be used to get the column value for a version enabled multiple lines of text column." The column I need the before and after values is a choice column

Choice column is also supported in the function 'getcolumnvalueforversion'. The above article only uses the 'multiple lines of text' column as an example

Please let us know if you're updating the 'ItemStatus' column in the workflow, or just trying to retrieve its previous value, so we can advise accordingly.

pf-amalin has reacted to this post.
pf-amalin

The need right now is for determining the before and after values. We might want to update the status in the future if it's straightforward, but not needed at this point.

Thanks!

 

Hi Art,

If the 'ItemStatus' column is not being updated by the workflow, you can use the getcolumnvalueforversion function to store its previous value in a variable. The current (after) value can be directly stored in another variable, as it reflects the latest value of the column.

To capture the before value in a variable:

  1. Open the workflow
  2. Click on ‘variables’ on the top → Click on ‘New variable’ → name it as ‘varBefore’
  3. Click on hamburger icon beside ‘Default value’ to open the expression builder and configure it as shown in image 1
  4. Click on ok and save the variable

To capture the after value in a variable:

  1. Open the workflow
  2. Click on ‘variables’ on the top → Click on ‘New variable’ → name it as ‘varAfter’
  3. Click on hamburger icon beside ‘Default value’ to open the expression builder and configure it as shown in image 2
Uploaded files:
  • 1.png
  • 2.png