Skip to content

String Condition

Evaluates boolean conditions between two strings. Supports equality, inequality, substring checks, regex match, and prefix/suffix checks, with optional case sensitivity. Returns a single boolean result.
Preview

Usage

Use this node to gate logic based on string comparisons, such as validating user input, filtering text, or controlling flow based on names, tags, or identifiers. Select the desired operation, provide the two strings, and set case sensitivity to match your intended behavior.

Inputs

FieldRequiredTypeDescriptionExample
aTrueSTRINGLeft-hand string value to compare.Hello World
bTrueSTRINGRight-hand string value used as comparison target or pattern.hello
operationTrueENUMComparison to perform between a and b. Options: a == b, a != b, a IN b (substring), a MATCH REGEX(b) (pattern match), a BEGINSWITH b (prefix), a ENDSWITH b (suffix).a IN b
case_sensitiveTrueBOOLEANIf false, both a and b are lowercased before comparison (including regex pattern).false

Outputs

FieldTypeDescriptionExample
resultBOOLEANTrue if the selected condition holds for the given inputs; otherwise False.true

Important Notes

  • Case sensitivity: When case_sensitive is false, both a and b are converted to lowercase before evaluating the condition (including regex patterns).
  • Regex match: a MATCH REGEX(b) uses a pattern match against the start of a (equivalent to a 'match', not a 'search'). Invalid regex patterns produce False.
  • Substring semantics: a IN b returns True if a occurs anywhere within b.
  • Prefix/Suffix: a BEGINSWITH b checks a starts with b; a ENDSWITH b checks a ends with b.
  • Empty strings: Be mindful that empty strings can lead to True for certain operations (e.g., '' IN b, or any string begins/ends with '').

Troubleshooting

  • Unexpected False with regex: Ensure b is a valid regex. If case_sensitive is false, remember your pattern is lowercased; escape special characters if you intend a literal match.
  • Case-related mismatches: Toggle case_sensitive or normalize your inputs to achieve the expected comparison.
  • Substring direction confusion: For 'a IN b', the left value a is the substring and the right value b is the container; reverse them if you intended the opposite.
  • Leading/trailing spaces: Trim whitespace in a and b if spacing causes unintended results.
  • Prefix/Suffix confusion: For 'a BEGINSWITH b' and 'a ENDSWITH b', b is the prefix/suffix to check against a.