---
url: /process-functions/process-reject.md
description: Rejects the current record in a process's data function.
---

# process.reject

Rejects the current record in a process's `data` function, as invalid. The rest of `data` doesn't run for this record, and the process carries on with the next one. The message is counted and shown in the process log when the process finishes.

```js
process.reject(message)
process.reject(group, message)
```

## Parameters

| Parameter | Type | Description |
|---|---|---|
| `group` | `string` | Optional. A group to list the message under in the log. |
| `message` | `string` | The reason the record was rejected. |

## Examples

::: code-group

```js [data.js]
function data(record) {
    // This function is called once for each line of data on the second cycle
    // Use this to build dimensions and push data into cubes

    if (record.name == "Demo") {
        process.reject("Error", "Rejecting record with name 'Demo'.");
    }

    // Continue rest of data function
}
```

```text [Log]
Rejection Log:
Group: Error
Rejecting record with name 'Demo'. [3]
```

:::

Each message is listed once, with a count of how many times it happened. Here, three records were named `Demo`.

## Related

* [process.skip](/process-functions/process-skip)
