# Advanced Validations

## Validations

#### Range

Validates that field's values for `Number` and `Double` columns fall within a `min` and `max` values. Either `min`, `max` or `both` must be defined. Values are inclusive.

<table><thead><tr><th>Name</th><th>Value</th><th data-type="checkbox">Is Required</th></tr></thead><tbody><tr><td><code>validate</code></td><td><code>range</code></td><td>true</td></tr><tr><td><code>min</code></td><td></td><td>false</td></tr><tr><td><code>max</code></td><td></td><td>false</td></tr><tr><td><code>errorMessage</code></td><td></td><td>false</td></tr></tbody></table>

#### Length

Validates that field's value for `String` column falls within `min` and `max` number of characters.

Either `min`, `max` or `both` must be defined. Values are inclusive.

<table><thead><tr><th>Name</th><th>Value</th><th data-type="checkbox">Is Required</th></tr></thead><tbody><tr><td><code>validate</code></td><td><code>length</code></td><td>true</td></tr><tr><td><code>min</code></td><td></td><td>false</td></tr><tr><td><code>max</code></td><td></td><td>false</td></tr><tr><td><code>errorMessage</code></td><td></td><td>false</td></tr></tbody></table>

#### Unique Across Multiple Fields

Validate uniqueness across multiple fields. To use it, place a `unique_with` validation on each field that you want to be part of the uniqueness validation, all sharing the same `uniqueKey`.

<table><thead><tr><th>Name</th><th>Value</th><th data-type="checkbox">Is Required</th></tr></thead><tbody><tr><td><code>validate</code></td><td><code>unique_with</code></td><td>true</td></tr><tr><td><code>uniqueKey</code></td><td></td><td>false</td></tr><tr><td><code>errorMessage</code></td><td></td><td>false</td></tr></tbody></table>

Here is an example set of fields using `unique_with` validations used to validate that the combination of `department code` and `employee Id`   fields are unique.

<pre class="language-json"><code class="lang-json"><strong>[
</strong>  {
    "key": "Department Code",
    "name": "Department Code",
    "type": "String",
    "validations": [
      {
        "validate": "unique_with",
        "uniqueKey": "Employee No"
      }
    ]
  },
  {
    "key": "Employee Id",
    "name": "Employee Id",
    "type": "Number",
    "validations": [
      {
        "validate": "unique_with",
        "uniqueKey": "Employee No"
      }
    ]
  }
]
</code></pre>

Here is the example of `unique_with` validation in action,

<figure><img src="/files/09SaUa04poJqxeptX3hf" alt=""><figcaption><p>Checking uniqueness of Employee No using unique_with validation</p></figcaption></figure>

## Adding Validations

### From Platform

1. Click on `Validations` while adding column or click on `Edit` to edit the column.<br>

   <figure><img src="/files/uO4muEmNvhTOTutPiTx6" alt=""><figcaption><p>Mentioning Validations</p></figcaption></figure>
2. Assign validations as needed,<br>

   <figure><img src="/files/5QPuIzSANBHrdzIkoEwh" alt=""><figcaption><p>Assigning validations from web UI</p></figcaption></figure>

### From Code

You can check the advanced validations sections in react( [React Embed](/importer/react-embed.md#advanced-validations)), angular [Angular Embed](/importer/angular-embed.md#advanced-validations)) and javascript ([HTML & JS Embed](/importer/html-js-embed.md#advanced-validations))

***

If you have any questions, suggestions, or comments. Feel free to reach out to us over [**Discord**](https://discord.impler.io). We’re constantly improving to deliver the best Data Importer for your product, and we value your input.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.impler.io/validations/advanced.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
