Validation rules help you easily differentiate valid documents from invalid ones. Here’s a simple guide to setting up your first validation rule.
Context
Suppose you need to collect IDs and Passports and ensure they meet specific requirements:
- Documents must be from authorized countries (e.g., UK, France, Belgium, Netherlands).
- Documents must be either an ID or a passport.
- Documents cannot be expired.
Step-by-Step Guide
1. Create Your Rule Set
- Log into CheckHub and navigate to "Settings" in the header menu.
- Go to "Validation" and click on "Add Validation". Name your validation rule (ex: “ID/Passport Validation”). Ignore the scores for now.
2. Set the First Rule: Country
- Set the fieldname to "class_country_code".
- Leave the type as "String".
- Select the operator "is not in list".
- Enter the list of valid countries: UK, BEL, FRA, NDL (no quotes or spaces).
- Set the action to "Reject Document".
3. Set the Second Rule: Document Type
- Set the fieldname to "class".
- Leave the type as "String".
- Select the operator "is not in list".
- Enter the list of valid types: IDENTITY_CARD, PASSPORT (no quotes or spaces).
- Set the action to "Reject Document".
4. Set the Final Rule: Expiration Date
- Set the fieldname to "expirationDate".
- Set the type to "Date".
- Select the operator "before (period)".
- Set Amount to 0 and Units to days. This rule checks that the document's expiration date is not older than today.
- Save your changes
Your Validation Rule is Ready!
Now, your validation rule is set up and ready to ensure only the valid documents are accepted.
All you need to do is to activate it in the proper document type. To do so
- Go to Settings > Document Type and select your document “ID/Passport” (or equivalent)
- Edit Validation Method and select your new validation “ID/Passport Validation”