Crow Canyon Software Forum

Forum Navigation
Please or Register to create posts and topics.

Advanced Conditions on Variable Value

I'm trying to use an Advanced Condition in a conditional to see if a variable (set earlier by regextract) has a length greater than 5. Here is my condition syntax:

Advanced Condition greater than $strlen(varEMPLID##Value),,5

When the workflow runs, I see that the string length is greater than 5, but the condition always evaluates to false, whether the string length is greater or less than 5.

=================
Begin action execution ...
=================
Action Title: Check for emplid query
Action Type: Gateway
Column type: "Advanced column"
Condition evaluation information:
-----------------
Column value: "7"
Operator: "Greater Than"
Condition evaluated value: "5"
-----------------
Result: false
-----------------
Condition evaluation result: false
Conditions evaluation result: false
Conditions matched: "false"
Successfully Executed

Hi @jlazzaro,

You can't directly use functions in the Advanced Condition. The best way to handle this is to use a Set Variable action for the $strlen function to map the value to either new variable or the same variable (if you don't use the variable later in the Workflow). You can then use that new variable (e.g. EmpIDLen) in the Advanced Condition, like EmpIDLen##value,,5

See if that works and let me know.

Thanks for the quick response! That doesn't seem to work either unless I'm missing something else. I notice that the result of setting varIDLength is 7, not in quotes, while the advanced condition is showing both 7 and 5 in quotes. Is it possible that it's trying to do a numeric comparison but treating the values as strings or am I reading too much into the log formatting?

Set varIDLength to $strlen(varEMPLID##Value)

Advanced Condition greater than varIDLength##Value,,5

Debug Log:

=================
Begin action execution ...
=================
Action Title: Set ID Length for EMPLID
Action Type: SetVariableValue
Variable: "varIDLength"
Expression: $strlen(varEMPLID##Value)
Expression Value: 7
-----------------
Successfully Executed
=================
Begin action execution ...
=================
Action Title: Check for emplid query
Action Type: Gateway
Column type: "Advanced column"
Condition evaluation information:
-----------------
Column value: "7"
Operator: "Greater Than"
Condition evaluated value: "5"
-----------------
Result: false
-----------------
Condition evaluation result: false
Conditions evaluation result: false
Conditions matched: "false"
Successfully Executed

Hi @jlazzaro,

Please edit the workflow -> Modify gateway condition as shown below -> Save gateway settings -> Publish the workflow and check the result.

Condition:

Advanced Condition ‘greater’ $strlen(VariableName##value),,5,,Number

<Screenshot attached>

Uploaded files:
  • gatewayCondition.png

That worked perfectly, thank you!