LAST_INDEX_OF
Returns the last index of the specified term within the provided string or array. With arrays you provide a LAMBDA as the second argument.
Categories: Arrays, Text
Syntax
LAST_INDEX_OF(string_or_array, term)
Examples
Example 1
Input
1
{
2
"my_action": {
3
"data": [
4
"foo",
5
"bar",
6
"foo"
7
]
8
}
9
}
Formula
LAST_INDEX_OF(my_action.data, "foo")
Output
2
Example 2
Input
1
{
2
"my_action": {
3
"string": "foo bar foo"
4
}
5
}
Formula
LAST_INDEX_OF(my_action.string, "foo")
Output
8
Example 3
Input
1
{
2
"my_action": {
3
"data": [
4
"foo",
5
"bar"
6
]
7
}
8
}
Formula
LAST_INDEX_OF(my_action.data, "cat")
Output
"NULL"
Example 4
Input
1
{
2
"my_action": {
3
"data": [
4
"foo",
5
"bar"
6
]
7
}
8
}
Formula
LAST_INDEX_OF(my_action.data, LAMBDA(a, a = "bar"))
Output
1