The CreatorCon Call for Content is officially open! Get started here.

use current.varable_name and previous.variable_name functionality in a workflow?

khurdle
Kilo Contributor

I am scripting within a workflow and am trying to trigger an action based on if a boolean field value has changed.   Since workflow activities do not have the built in "change" condition like a business rule, I am attempting to do this with a condition.   In an "IF" workflow activity, I have " if (current.variable_name == true &&   previous.variable_name == false) {run script} ".   The function is not able to enter this statement, because it does not recognize the use of current.variable_name or previous.variable_name.   Can I use these key words in a workflow script?

ifstatement.PNG

Any insight appreciated!

5 REPLIES 5

ccajohnson
Kilo Sage

Unfortunately I have found that variables do not behave the same way as fields when it comes to changes (previous vs current). Where is this variable set? Is it set somewhere in a task? What is the business reason for doing something when the variable changes?



The only thing I can think of is setting a workflow scratchpad before the variable is expected to be changed, then check the current.variable_name against the workflow.scratchpad value after the time when the variable is expected to be changed.