Skip to content

String Condition

Evaluates a boolean condition between two strings using common string operations. Supports equality/inequality, containment, regex match, and prefix/suffix checks, with an option to enable or disable case sensitivity. Returns a single boolean result indicating whether the condition holds.
Preview

Usage

Use this node to branch logic or filter data based on string relationships. Typical scenarios include checking if a keyword exists in text, ensuring exact matches, validating formats via regex, or confirming prefixes/suffixes. Configure case sensitivity to control whether comparisons normalize case before evaluation.

Inputs

FieldRequiredTypeDescriptionExample
aTrueSTRINGFirst string to evaluate (left-hand side in the selected operation).hello
bTrueSTRINGSecond string to evaluate (right-hand side in the selected operation). Used as the comparator, container, pattern, prefix, or suffix depending on the operation.Hello world
operationTrueSTRINGThe string operation to evaluate: one of 'a == b', 'a != b', 'a IN b', 'a MATCH REGEX(b)', 'a BEGINSWITH b', or 'a ENDSWITH b'.a IN b
case_sensitiveTrueBOOLEANIf true, comparisons are case-sensitive. If false, both inputs are transformed to lowercase before evaluation (including the regex pattern).False

Outputs

FieldTypeDescriptionExample
resultBOOLEANBoolean outcome of the selected string condition.True

Important Notes

  • Case sensitivity applies to all supported operations. When disabled, both inputs (including the regex pattern) are lowercased before evaluation.
  • Regex is evaluated using a 'match' operation, which tests from the start of the string rather than anywhere in the string. Use patterns accordingly (e.g., '.*' to match anywhere).
  • If the provided regex pattern is invalid, the node returns False and logs a warning.
  • 'a IN b' checks whether the entire string 'a' is a substring of 'b'.
  • Unknown operations result in a False outcome.
  • Inputs are single-line strings; trim or normalize your inputs if leading/trailing whitespace matters.

Troubleshooting

  • Unexpected False with regex: Ensure your pattern is valid and consider that matching starts at the beginning of the string. Add '.*' or anchors as needed.
  • Case-related mismatches: Toggle 'case_sensitive' or normalize your inputs if expected matches fail due to casing.
  • Containment not working: Verify that 'a' is the substring you expect to find within 'b' (the operation is 'a IN b', not 'b IN a').
  • Prefix/suffix checks failing: Confirm that whitespace or hidden characters are not affecting startswith/endswith results.
  • Always False: Confirm the 'operation' selection is one of the supported options and that both inputs are provided.