Skip to content

If Statement

The If Statement node evaluates a list of user-defined conditions and returns True if all conditions are met, or False otherwise.


Purpose

✅ Perform conditional logic within workflows.
✅ Dynamically control execution paths based on data evaluations.
✅ Support comparisons for string, number, date, boolean, and object data types.


Inputs

Field LabelInput TypeDescription
ConditionsJSON ArrayA list of conditions to evaluate. Each condition must include Input, Compare, DataType, and Operator.

Condition Object Structure

PropertyTypeDescription
InputTextThe left-hand value to compare. Supports placeholders for data variables.
CompareTextThe right-hand value to compare against. Supports placeholders for data variables.
DataTypeTextThe data type for comparison. Supported values: string, number, datetime, boolean, object.
OperatorTextThe operator to use for comparison. Varies by data type (see Supported Operators section).

Supported Operators

String

  • equals
  • notEquals
  • contains
  • startsWith
  • endsWith

Number

  • equals
  • notEquals
  • greaterThan
  • lessThan
  • greaterOrEqual
  • lessOrEqual

DateTime

  • before
  • after
  • equals
  • notEquals

Boolean

  • equals
  • notEquals

Object

  • deepEquals – Checks if two JSON objects are deeply equal
  • notEquals – Checks if two JSON objects are not deeply equal

Outputs

Output VariableDescription
statusReturnReturns "True" if all conditions are met, otherwise "False".
taskMessage"All conditions met" or "One or more conditions failed".

Example Use Case

✅ Check if an invoice amount exceeds a threshold and the status is Approved.
✅ Validate that an input date is after today.
✅ Compare two JSON payloads for equality to trigger downstream processing.

Example Conditions Input

json
[
  {
    "Input": "{InvoiceAmount}",
    "Compare": "1000",
    "DataType": "number",
    "Operator": "greaterThan"
  },
  {
    "Input": "{ApprovalStatus}",
    "Compare": "Approved",
    "DataType": "string",
    "Operator": "equals"
  }
]

Tentech 2024