Skip to main content

CONTAINS

CONTAINS:
arg: { arg } # required
search: { search } # required

Description

The CONTAINS operation checks if a searchable value (arg) contains another value (search). This operation is versatile and works for both text and collection comparisons.

  • When arg is Text or Bytes, it performs a substring search.
  • When arg is a List or Set, it checks for the presence of an element.

The comparison is case-insensitive for Text types and case-sensitive for Bytes types. It returns true if the arg contains the search value, and false otherwise.

Parameters

  • arg (Operation<Text | Bytes | List | Set>, required):
    • The value to be searched within (the haystack).
  • search (Operation<Text | Bytes>, required):
    • The value to search for (the needle).

Return Type

Boolean

Examples

  1. Checking if a field value contains a specific substring:

    CONTAINS:
    arg:
    FIELD:
    path: CA10__description__c
    search:
    TEXT: "expired"
  2. Checking if a set of allowed ports contains port 22:

    CONTAINS:
    arg:
    SET_FROM:
    arg:
    FIELD:
    path: CA10__allowedPorts__c # e.g., "80,443,22"
    separator: ","
    search:
    TEXT: "22"