4.6. Validation node

If you want to learn more about this feature, an e-learning tutorial is available below:

Split good and bad data with a Validation Node

../../_images/N_EN_11.png

The validation node is a tool that will quickly become essential for visually separating problematic data from the others in your flows.

Icon: image119

  • Number of inputs: 1.

  • Number of outputs: 1 or 2.

Definition

A validation node sends valid records to its first output and invalid records to its second output, if there is one.

Configuration

Two types of validation are available:

  • Validation by field (Field validation rules tab image120). Check performed for each selected field:

    • Type:

      where cells contain a value not recognized as valid, the record concerned will be sent to the second output of the node (= invalid records).

    • Nature:

      where cells contain a value not recognized as valid, the record concerned will be sent to the second output of the node (= invalid records).

    • Presence:

      where cells do not contain a value, the record concerned will be sent to the second output of the node (= invalid records).

    • Check of field validation rules as defined in an upstream preparation function:

      in the specified field, where cells contain a value that is invalid under the rule (e.g. list of permitted values or validity interval), the relevant record will be sent to the second output of the node (= invalid records).

  • Validation by record (Row validation rules tab, image121).

    Record validity will be checked for each ticked rule. Invalid records will be sent to the second output of the node (= invalid records). Record validation rules must be attached to an upstream preparation node.

Visual example

image122

In this example, validation by field has been set up to check each field for:

  • Type. In this date field, where cells contain a value that is not recognized as a valid date, the relevant record will be sent to the second output of the node (= invalid records).

  • Nature. In this field identified as containing emails, where cells contain a value that is not recognized as a valid email, the relevant record will be sent to the second output of the node (= invalid records).

  • Presence: Where cells do not contain any value, the relevant record will be sent to the second output of the node (= invalid records).

Practical examples

Note

Example 1: Basic Field Validation with Nature Check

Before operation:

ID

Email

Age

Registration Date

Phone Number

1

user@example.com

25

2021-05-21

123-456-7890

2

invalid-email

30

2020-11-15

987-654-3210

3

anotheruser@domain.ai

19

2022-01-10

Hello

Node Configuration:

  • Field Filter Configuration:

    • Check Nature for the “Country Code” column: Nature must match a valid ISO-3166-1 alpha3 code.

    • Check field rule for the “Amount” column: Must be a positive number (type check).

    • Check Nature for the “Phone Number” column: Nature must be a valid telephone number format.

    • Check that Registration Date is Not empty.

After operation:

  • Valid Records (green output):

ID

Email

Age

Registration Date

Phone Number

1

user@example.com

25

2021-05-21

123-456-7890

  • Invalid Records (red output):

ID

Email

Age

Registration Date

Phone Number

2

invalid-email

30

2020-11-15

987-654-3210

3

anotheruser@domain.ai

19

2022-01-10

Hello

In this example, record 2 is invalid due to an incorrect email format, and record 3 is invalid because the phone number does not match the expected nature of a valid telephone number format.

Note

Example 2: Combined Field and Record Validation with Type and Nature Checks

Before operation:

ID

Amount

Discount

Final Price

Country Code

1

100

10

90

USA

2

150

20

140

FRA

3

200

15

185

Hello

Node Configuration:

  • Field Filter Configuration:

    • Check field rule for the “Amount” column: Must be a positive number (type check).

    • Check field rule for the “Discount” column: Must be between 0 and 30 (type and range check).

    • Check field rule for the “Final Price” column: Numeric value check.

    • Check Nature for the “Country Code” column: Nature must match a valid ISO-3166-1 alpha3 code.

  • Record Filter Configuration:

    • Select Rule: Final Price must be equal to Amount - Discount (You need to create the record rule in a Preparation Node upstream).

After operation:

  • Valid Records (green output):

ID

Amount

Discount

Final Price

Country Code

1

100

10

90

USA

  • Invalid Records (red output):

ID

Amount

Discount

Final Price

Country Code

2

150

20

140

FRA

3

200

15

185

Hello

In this example, the second record is invalid due to a mismatch between the “Final Price” and the calculated “Amount - Discount”, and the third record is invalid because “Hello” does not match the nature of a valid ISO country code.