Evaluate Expression
I am trying to use logic like =IF(a == b, true, false) in the evaluate expression activity, but keep getting an error that states IF is not a function. What is the correct syntax in workflow? Or if this is not possible in workflow, how do a declare a new value for a variable that already exists in the workflow?
Thanks,
Chris.
-
The Evaluate Expression does the true or false as the result from the expression evaluation.
All you need is: =$varA == $varB
Then call $evaluate1.result to find if true or false
1 -
I use ternary operators: <conditional> ? <expression if true> : <expression if false>.
For example, imagine a form-based data creation WF. You might use the same WF for editing and creation, with edits prefilling the form with existing data. You'd probably have a nice boolean variable that determines whether to run that logic, the input expression for a Create Value activity "isEdit" might be
= $wfInputs.inputs.type == 'edit' ? true : false
2 -
Zack,
I must not have gotten my syntax right when I tried this before. I followed your example and got the evaluate expression to work using the code below. This is just what I needed!
Thanks,
Chris
= $form1.state.dropDownList2.value === undefined ? $whereClause.result : $whereClause.result.concat(` OR field = ${$form1.state.dropDownList2.value}`0
Please sign in to leave a comment.
Comments
3 comments