Skip to main content Link Search Menu Expand Document (external link)

text_contains_strings

Category: String Description: Check if text contains subset of strings. Type: Condition

Description

Type: condition

Check if text contains one of possible strings.

Params

  • text: Input string
  • strings: An array of items where each item is either a string or array of strings. In case the item is array of strings, all strings must be found in the text.

Outputs

No additional info is added to the global payload outputs.

Usage Example

if:
  conditions:
  - conditionId: text_contains_strings
    params:
      text: "${userMessageText}"
      strings:
      - mobile
      - ios
      - android
  then:
    ...

The text_contains_strings condition is used to verify that text entered by the user in Snack means mobile/ios/android.

In case each string param is array of strings, the condition will search for one of the string, so for example:

      strings:
      - one
      - - two
        - three    

Will search for "one" **and** ("two" **or** "three")

Relevant Triggers

All triggers