Skip to main content Skip to complementary content

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 > Structures.
  2. Import hardware_request.csv as a Structure. This creates a new hardware_request Structure.
  3. Right-click Hierarchical Mapper > Maps and select New > 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 drop it in the Validate tab.
  9. Double-click on CondValidateReport and enter Invalid Department in the Message field.
  10. In the Condition section, drag-and-drop the Equal function.
  11. In the First Value section, drag-and-drop the Constant function and enter Sales in its Value field.
  12. In the Second Value section, drag-and-drop 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 > Import Document from File and select the hardware_request.csv file you just edited.
  15. Click Test Run to see the results:
  16. Repeat step 13. Modify Sales to Support.
  17. Repeat steps 14-15. See that an error is displayed after clicking Test Run.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!