---
title: REJECT
url: https://www.tines.com/docs/formulas/functions/reject/
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)*

# REJECT

*[View on tines.com](https://www.tines.com/docs/formulas/functions/reject/)*

Rejects items from an array or an object by a lambda function or an array of values to remove.

If the target is an array, the lambda must take one argument: the value.

If the target is an object, the lambda can take one or two arguments. If the lambda takes one argument, the argument is the value. If the lambda takes two arguments, the first argument is the key and the second argument is the value.

**Categories:** Lambdas, Arrays, Objects

## Syntax

```
REJECT(array | object, values_to_remove | LAMBDA(arg1, [arg2], expr))
```

## Examples

### Example 1

Input:

```json
{
  "my_array": [
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10
  ]
}
```

Formula:

```
REJECT(my_array, ARRAY(2, 4, 6, 8, 10))
```

Output:

```json
[
  1,
  3,
  5,
  7,
  9
]
```

### Example 2

Input:

```json
{
  "my_array": [
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10
  ]
}
```

Formula:

```
REJECT(my_array, LAMBDA(item, item > 5))
```

Output:

```json
[
  1,
  2,
  3,
  4,
  5
]
```

### Example 3

Input:

```json
{
  "my_object": {
    "a": 1,
    "b": 2,
    "c": 3,
    "d": 4,
    "e": 5
  }
}
```

Formula:

```
REJECT(my_object, ARRAY(2, 4))
```

Output:

```json
{
  "a": 1,
  "c": 3,
  "e": 5
}
```

### Example 4: If the target is an object and the lambda takes one argument, the argument is the value.

Input:

```json
{
  "my_object": {
    "a": 1,
    "b": 2,
    "c": 3,
    "d": 4,
    "e": 5
  }
}
```

Formula:

```
REJECT(my_object, LAMBDA(value, value > 2))
```

Output:

```json
{
  "a": 1,
  "b": 2
}
```

### Example 5: If the target is an object and the lambda takes two arguments, the first argument is the key and the second argument is the value.

Input:

```json
{
  "my_object": {
    "a": 1,
    "b": 2,
    "c": 3,
    "d": 4,
    "e": 5
  }
}
```

Formula:

```
REJECT(my_object, LAMBDA(key, value, key = 'a' || value > 3))
```

Output:

```json
{
  "b": 2,
  "c": 3
}
```

## Sample actions

```json
{
  "standardLibVersion": "13",
  "actionRuntimeVersion": "1",
  "agents": [
    {
      "disabled": false,
      "name": "REJECT",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "reject": "=REJECT(my_action.object_array, LAMBDA(object, INCLUDES(object.name, 'Martin')))"
        }
      },
      "position": {
        "x": -6555,
        "y": -1305
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    },
    {
      "disabled": false,
      "name": "My Action",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "object_array": [
            {
              "name": "Martin"
            },
            {
              "name": "Shelby"
            },
            {
              "name": "Thomas"
            }
          ]
        }
      },
      "position": {
        "x": -6555,
        "y": -1440
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    }
  ],
  "links": [
    {
      "sourceIdentifier": 1,
      "receiverIdentifier": 0
    }
  ],
  "diagramNotes": []
}
```
