Skip to main content

Text Includes

Uncontrolled node

Overview

The Text Includes node checks whether a specific pattern (substring) exists within a given piece of text. It outputs a boolean value (true or false) depending on whether the pattern is found.

This node is useful for conditional logic, filtering text, or validating content without needing to know the exact position of the pattern.

Inputs

InputTypeDescriptionDefault
TextTextThe source text to search within.-
PatternTextThe substring or pattern to search for within the text.-

Outputs

OutputTypeDescription
IncludesBooleanReturns true if the pattern is found within the text, otherwise returns false.

Runtime Behavior and Defaults

The Text Includes node is an uncontrolled node, meaning it runs automatically whenever its inputs change. It does not require an event trigger to execute.

  • Case Sensitivity: The search is case-sensitive. For example, searching for "Hello" in "hello world" will return false.
  • Empty Strings: If the pattern is an empty string, the node will return true (as an empty string is technically included in every string).
  • Invalid Inputs: If either input is not a valid string, the node defaults to outputting false.
  • Partial Matches: The node uses JavaScript's String.prototype.includes() method, which checks for the exact substring anywhere within the text.

Example Usage

Checking for a Domain in an Email

Use the Text Includes node to verify if an email address contains a specific domain:

  1. Connect an email string to the Text input.
  2. Set the Pattern input to "@gmail.com".
  3. The Includes output will be true if the email is a Gmail address, allowing you to branch your workflow using an If node.

Filtering a List of Comments

Combine with the Filter List node to remove comments containing specific words:

  1. Use Text Includes inside a Filter List pattern to check if each comment contains the word "spam".
  2. Invert the result (using a Not operation or similar logic) to keep only comments that do not include the pattern.