# Validate

This document explains how the *Validate* object is used to check whether your dataset meets certain conditions or rules before you use it further in your recipe. Think of it as a way to flag rows that don’t match expectations.

### Example Use Case

Suppose you are working with a customer's table. Some customers don’t provide a fax number, but your business requires it for all active customers. You can configure the *Validate object* to identify these missing values.

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FRaFRsnttRJN8yeAToup2%2Fimage.png?alt=media&#x26;token=1f82644f-e142-4009-98a7-15de96829b0c" alt=""><figcaption></figcaption></figure>

1. In the toolbar, click on *Validate* and select the *Validate* option.

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FayHlfFU6JO4S3i2C2RoD%2Fimage.png?alt=media&#x26;token=3515ef20-2f79-4e89-ad51-3794a882fe0b" alt=""><figcaption></figcaption></figure>

2. This will open the *Recipe Configuration – Validate* panel.&#x20;

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FLgVj80xyiZecgxa8HI5f%2Fimage.png?alt=media&#x26;token=384f9569-3ae6-45d0-a883-dc0ce263f018" alt="" width="392"><figcaption></figcaption></figure>

3. In this panel, you’ll configure the following options:

* **Description:** Enter a meaningful name for the rule (e.g., “Missing Fax Validation”).
* **Attach Rule to Field:** Select a field to associate the rule with. For example, the *Fax* column.

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FfFHz2L0qjiOIpojPxrVr%2Fimage.png?alt=media&#x26;token=78a2a07f-8f8d-4c43-b4ec-a13319e61443" alt="" width="368"><figcaption></figcaption></figure>

* **Show Message:** Provide a custom error or warning message that appears when a record fails the rule.
* **Severity:** Choose whether a failed rule should be treated as an:
  * **Error:** The record is flagged and goes to the Invalid Output.
  * **Warning:** The record is flagged but still treated as valid
* **Rule Condition**: Enter the expression for your rule by typing it directly or using the Expression Builder <img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FAEqtKEpZJ5RQ9YqKFm4t%2Fimage.png?alt=media&#x26;token=b083b836-9e75-4eae-95da-918f1755dc39" alt="" data-size="line"> with built-in functions, operators, and fields.

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FXfsiTT692n1Zi98xMZhz%2Fimage.png?alt=media&#x26;token=3047187f-0556-4ae2-9b45-88183ddf43dd" alt="" width="563"><figcaption></figcaption></figure>

4. Once you’re done, click <img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FifRsY7qKnkoiKAz3ijZ3%2F7.png?alt=media" alt="" data-size="line"> *Apply.*

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FtYCs4gxXfUmbwv8VLMim%2Fimage.png?alt=media&#x26;token=d6d47531-38e1-417e-afe6-919329351c0b" alt="" width="420"><figcaption></figcaption></figure>

5. In the preview grid, records matching the "Missing Fax Validation" rule are validated. Conversely, records not matching the rule display an error, indicated by a red warning sign.

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2F1Gv4pnpFrKwgm36xz1AY%2Fimage.png?alt=media&#x26;token=89397205-8d1e-45b3-a08a-dbb3b6b759c2" alt=""><figcaption></figcaption></figure>

6. The records that fail to match the validation rule can be written and stored in a separate error log. Click [here](https://documentation.astera.com/exporting-data#write-to-log-file) to learn how you can store erroneous records to a log file.

<figure><img src="https://3181888596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzEifS4h8yurLAAwiGNX2%2Fuploads%2FQsbKjc1iJxd72fADBgkP%2Fimage.png?alt=media&#x26;token=421ce495-194d-44e0-8cb6-5a422c4c93d8" alt=""><figcaption></figcaption></figure>
