Search K
Appearance
Appearance
Evaluates an ordered set of SQL-condition rules against a connected SQL Server and returns the value of the first matching rule.
Use this task to implement branching business logic without building nested If Statement nodes. Rules are defined as a JSON array of labeled conditions, each containing a SQL WHERE-style expression and an associated return value. The task evaluates rules in order and returns the result coerced to the chosen type. A legacy single-string expression format is also supported for migrating existing logic. Because conditions are executed inside a SQL CASE WHEN wrapper on the connected server, they can reference any data already available as workflow variables.
| Field | Type | Required | Description |
|---|---|---|---|
| Evaluation Mode | Dropdown | Yes | Structured Table evaluates a JSON array of rules. Legacy Expression evaluates a single comma-separated clause string. |
| Rules JSON | Multi-line Text | No | Ordered array of rule objects, each with Label, Value, and Condition fields. Condition uses SQL WHERE syntax. |
| Legacy Equation | Multi-line Text | No | Comma-separated clauses in the form Var = Value IF condition. Used when Evaluation Mode is Legacy Expression. |
| Else Value | Text | No | Value returned when no rule matches. Leave blank to raise a failure when nothing matches. |
| Return Type | Dropdown | Yes | How to coerce the matched value: number, string, boolean, or json. |
| Stop At First Match | Checkbox | Yes | When checked, evaluation stops at the first matching rule. When unchecked, all rules are evaluated and the last match is used. |
| Condition Safety | Dropdown | Yes | Controls SQL condition validation. Lenient (raw SQL) applies no checks. Safe (sanitize) blocks comment and injection tokens. Strict (allow-list) additionally restricts identifiers to those in the Allowed Columns field. |
| Diagnostics Level | Dropdown | Yes | Controls how much diagnostic data is returned alongside the result: none, basic, or verbose. |
Rules JSON is only shown when Evaluation Mode is set to Structured Table. Legacy Equation is only shown when Evaluation Mode is set to Legacy Expression.
| Name | Description |
|---|---|
| Result | The value returned by the matched rule, coerced to the selected Return Type. Present when Diagnostics Level is none. |
| Diagnostics | An object containing EvaluatedCount, MatchedIndex, MatchedLabel, and (in verbose mode) the preview SQL. Present when Diagnostics Level is basic or verbose. |