Search
⌃K
Links
Comment on page

contains

To check if a string or an array contains an exact match
This function helps you to check if a given string or array of any length contains the exact match you are looking for.
In case you are not only searching for a specific string or array but also need its position, you can use the index() function.
The result is true (Yes) for an exact match or false (No) for no exact match found.

Strings

This is case-sensitive, so you can use upper() or lower() to format your text first. contains() can be used to search for keywords in text fields or to determine if a specific option was selected in a multiple-choice field.

Arrays

An exact match means the searched value is equal to one of the array items.

Syntax

contains(string, string)
contains([any], any)

Return

boolean

Examples

contains(myText, match) to check if a given string contains an exact match.

Strings

1
contains("Hello world!", "Hello")
Result: Yes (true)
​
1
contains("Hello world!", "hello")
Result: No (false)
​
1
contains(lower("Hello world!"), "hello")
Result: Yes (true)

Arrays

contains([myArray], match) to check if a given array contains an exact match.
1
contains(["A", "B", "C"], "B")
Result: Yes (true)
​
1
contains([{ name: "Sam" }], { name: "Sam" })
Result: No (false)
JSON objects are not matched by their content but by their identity.

See also

​index, which returns the first position of a searched match in a string or an array.
Last modified 5mo ago