---
title: LAST_INDEX_OF
url: https://www.tines.com/docs/formulas/functions/last-index-of/
kind: formula-function
---

*[tines.com](https://www.tines.com/llms.txt) › [Docs](https://www.tines.com/llms.txt) › [Formulas](https://www.tines.com/llm/docs/formulas.md) › [Functions](https://www.tines.com/llm/docs/formulas/functions.md)*

# LAST_INDEX_OF

*[View on tines.com](https://www.tines.com/docs/formulas/functions/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:

```json
{
  "my_action": {
    "data": [
      "foo",
      "bar",
      "foo"
    ]
  }
}
```

Formula:

```
LAST_INDEX_OF(my_action.data, "foo")
```

Output:

```json
2
```

### Example 2

Input:

```json
{
  "my_action": {
    "string": "foo bar foo"
  }
}
```

Formula:

```
LAST_INDEX_OF(my_action.string, "foo")
```

Output:

```json
8
```

### Example 3

Input:

```json
{
  "my_action": {
    "data": [
      "foo",
      "bar"
    ]
  }
}
```

Formula:

```
LAST_INDEX_OF(my_action.data, "cat")
```

Output:

```json
"NULL"
```

### Example 4

Input:

```json
{
  "my_action": {
    "data": [
      "foo",
      "bar"
    ]
  }
}
```

Formula:

```
LAST_INDEX_OF(my_action.data, LAMBDA(a, a = "bar"))
```

Output:

```json
1
```
