﻿<head><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4357510538660394"
     crossorigin="anonymous"></script></head># notValues

> This document is the Markdown version of [valibot.dev/api/notValues/](https://valibot.dev/api/notValues/). For the complete documentation index, see [llms.txt](https://valibot.dev/llms.txt).

Creates a not values validation action.

```ts
const Action = v.notValues<TInput, TRequirement, TMessage>(
  requirement,
  message
);
```

## Generics

- `TInput` `extends ValueInput`
- `TRequirement` `extends readonly TInput[]`
- `TMessage` `extends ErrorMessage<NotValuesIssue<TInput, TRequirement>> | undefined`

## Parameters

- `requirement` `TRequirement`
- `message` `TMessage`

### Explanation

With `notValues` you can validate the value of a string, number, boolean or date. If the input matches one of the values in the `requirement`, you can use `message` to customize the error message.

## Returns

- `Action` `NotValuesAction<TInput, TRequirement, TMessage>`

## Examples

The following examples show how `notValues` can be used.

### Number schema

Schema to validate a number that is not 10, 11 or 12.

```ts
const NumberSchema = v.pipe(
  v.number(),
  v.notValues([10, 11, 12], 'The number must not be 10, 11 or 12.')
);
```

## Related

The following APIs can be combined with `notValues`.

### Schemas

[`any`](/api/any.md), [`bigint`](/api/bigint.md), [`boolean`](/api/boolean.md), [`custom`](/api/custom.md), [`date`](/api/date.md), [`number`](/api/number.md), 