# Implementing validation rules

Use a CondValidateReport function to implement validation rules on a hardware request form.

## Before you begin

Create a hardware\_request.csv file in your local machine. Populate your CSV file as such:

```
Name, Location, Department, HW_ID
```

## Procedure

1. In Talend Data Mapper, open Hierarchical Mapper &gt; Structures.
2. Import hardware\_request.csv as a Structure. This creates a new hardware\_request Structure.
3. Right-click Hierarchical Mapper &gt; Maps and select New &gt; Map.
4. Select Standard Map and create a new map called hardware-request.
5. Open the newly created hardware-request Map and drag the hardware\_request Structure to both the Input and Output tables.
6. Map each row from the Input to the corresponding row in the Output table.
7. Select the Department row from the Output table and open the Validate tab.
8. From the Functions tab, select CondValidateReport and place it in the Validate tab.
9. Double-click on CondValidateReport and enter Invalid Department in the Message field.
10. In the Condition section, place the Equal function.
11. In the First Value section, place the Constant function and enter Sales in its Value field.

    ![Properties of Constant function.](https://help.qlik.com/talend/en-US/data-mapper-user-guide/Resources/images/tdm_implementvalidation.png)
12. In the Second Value section, place the Department row from the Output table.
13. Open the hardware\_request.csv file to modify the entry. Replace the values with:
    ```
    John, Dublin, Sales, 12
    Harrison, Denver, Sales, 14
    ```
14. Select Show Document &gt; Import Document from File and select the hardware\_request.csv file you just edited.
15. Click Test Run to see the results:

    ![Test Run button.](https://help.qlik.com/talend/en-US/data-mapper-user-guide/Resources/images/tdm_validationrun.png)
16. Repeat step 13. Modify Sales to Support.
17. Repeat steps 14-15. See that an error is displayed after clicking Test Run.

    ![Test error.](https://help.qlik.com/talend/en-US/data-mapper-user-guide/Resources/images/tdm_validationerror.png)

### In this section

* [Creating a filter using a validation rule](https://help.qlik.com/talend/en-US/data-mapper-user-guide/8.0-R2025-10/creating-filter-using-validation-rule)