INDEX_OF

Returns the index of the specified term within the provided string or array. With arrays you provide a LAMBDA as the second argument.

Syntax 

INDEX_OF(string_or_array, term)

Usage examples 

Example 1

Input

1
{
2
"my_action": {
3
"data": [
4
"foo",
5
"bar"
6
]
7
}
8
}

Formula

INDEX_OF(my_action.data, "foo")

Output

0

Example 2

Input

1
{
2
"my_action": {
3
"string": "foobar"
4
}
5
}

Formula

INDEX_OF(my_action.string, "bar")

Output

3

Example 3

Input

1
{
2
"my_action": {
3
"data": [
4
"foo",
5
"bar"
6
]
7
}
8
}

Formula

INDEX_OF(my_action.data, "cat")

Output

"NULL"
Was this helpful?