> ## Documentation Index
> Fetch the complete documentation index at: https://fuse-docs.swovo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Adding Validations

> Validations allow you to provide error or warning messages to users when data is improperly formatted.

<Note>
  Each column type in Fuse has built-in validations. You refer to the documentation of a specific column type to see the available options.
</Note>

When the built-in data validations are insufficient, you can create custom front-end data validations using the `onValidateRecord` hook on your importer.

## `onValidateRecord(record)`

The `onValidationRecord` hook is called for each row (record) in the importer. It allows you to display front-end validations in the importer for the user to fix.

The `record` object passed to `onValidateRecord` contains all of the values for a single row in the importer. You can access values in the record object using the `internal_key `of each column in your importer.

The `onValidateRecord` hook returns an errors object with two properties:

* `errors` block the user from submitting an import. These are items that must be fixed.
* `warnings` provide a warning message to the user about potential issues. However, a user can submit an import with warnings present.

## Example

```javascript theme={null}
importer.onValidateRecord = async (record) => {
  const errors = {};
  const warnings = {};

  // force emails to include gmail
  if (!record.email?.includes("gmail")) {
    errors["email"] = "Email must from gmail";
  }

  return {
    errors: errors,
    warnings: warnings,
  };
};
```
