Skip to main content

If@1

Node If@1 allows to execute a sub transformation pipeline based on a condition. The node evaluates a condition and if true, executes the nested transformations.

Adapter Prerequisites​

  • General availability: All adapters support this node type.

Node Configuration​

For fields path, see Overview.

Configuration Properties​

PropertyTypeRequiredDescription
pathstringYesPath to the value to compare in the data context
operatorCompareOperatorNoComparison operator (default: Equals)
valueanyNo*Static value to compare against
valuePathstringNo*Path to a dynamic value to compare against
valueTypeAttributeValueTypeYesData type of the values being compared
transformationsarrayNoSub-pipeline executed when condition is true

*Either value or valuePath must be provided (or both can be null for null checks).

Supported Operators​

OperatorDescriptionAliases
EqualsChecks if values are equalEqual
NotEqualsChecks if values are not equalNotEqual
ContainsChecks if string contains substring (case-insensitive)Contain
LessThanChecks if value is less than comparison value-
LessEqualsThanChecks if value is less than or equal-
GreaterThanChecks if value is greater than comparison value-
GreaterEqualsThanChecks if value is greater than or equal-
StartsWithChecks if string starts with prefix (case-insensitive)-
EndsWithChecks if string ends with suffix (case-insensitive)-
RegexMatchChecks if string matches regular expression pattern-

Supported Value Types​

  • Boolean
  • Int (32-bit integer)
  • Int64 (64-bit integer)
  • Double
  • String
  • DateTime
  • Enum (stored as integer)

Example: Simple Equality Check​

transformations:
- type: If@1
path: $.customer.age
operator: Equals
value: 18
valueType: Int
transformations:
- type: SetPrimitiveValue@1
targetPath: $.customer.isAdult
value: true

Example: Range Check with Dynamic Value​

transformations:
- type: If@1
path: $.product.price
operator: GreaterThan
valuePath: $.customer.budget
valueType: Double
transformations:
- type: SetPrimitiveValue@1
targetPath: $.warnings
value: "Product exceeds customer budget"

Example: String Contains Check​

transformations:
- type: If@1
path: $.customer.email
operator: Contains
value: "@company.com"
valueType: String
transformations:
- type: SetPrimitiveValue@1
targetPath: $.customer.isEmployee
value: true

Example: Null Value Check​

transformations:
- type: If@1
path: $.customer.middleName
operator: NotEquals
value: null
valueType: String
transformations:
- type: Simulation@1
simulations:
- targetPath: $.customer.fullName
simulatorKey: Person.FullName

Example: String StartsWith Check​

transformations:
- type: If@1
path: $.product.sku
operator: StartsWith
value: "ELEC-"
valueType: String
transformations:
- type: SetPrimitiveValue@1
targetPath: $.product.category
value: "Electronics"

Example: String EndsWith Check​

transformations:
- type: If@1
path: $.file.name
operator: EndsWith
value: ".pdf"
valueType: String
transformations:
- type: SetPrimitiveValue@1
targetPath: $.file.type
value: "Document"

Example: Regular Expression Match​

transformations:
- type: If@1
path: $.customer.phone
operator: RegexMatch
value: "^\\+1[0-9]{10}$"
valueType: String
transformations:
- type: SetPrimitiveValue@1
targetPath: $.customer.region
value: "North America"

Behavior Notes​

  • String operators (Contains, StartsWith, EndsWith) perform case-insensitive comparisons
  • The RegexMatch operator uses standard .NET regular expression syntax and is case-sensitive
  • Comparison operators (LessThan, GreaterThan, etc.) require comparable value types
  • Null values are properly handled in equality/inequality checks
  • If the condition is not met, the sub-transformations are skipped and processing continues
  • The data context is preserved after the conditional transformations complete
  • For RegexMatch, escape backslashes must be doubled in YAML strings (e.g., "\\d+" for digit matching)