How can we help? 👋

Set up your first validation rule

Learn how to automatically validate or reject documents using validation rules

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.
    • Notion image

Step-by-Step Guide

1. Create Your Rule Set

  1. Log into CheckHub and navigate to "Settings" in the header menu.
  1. 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

  1. Set the fieldname to "class_country_code".
  1. Leave the type as "String".
  1. Select the operator "is not in list".
  1. Enter the list of valid countries: UK, BEL, FRA, NDL (no quotes or spaces).
  1. Set the action to "Reject Document".
    1. Notion image

3. Set the Second Rule: Document Type

  1. Set the fieldname to "class".
  1. Leave the type as "String".
  1. Select the operator "is not in list".
  1. Enter the list of valid types: IDENTITY_CARD, PASSPORT (no quotes or spaces).
  1. Set the action to "Reject Document".
    1. Notion image

4. Set the Final Rule: Expiration Date

  1. Set the fieldname to "expirationDate".
  1. Set the type to "Date".
  1. Select the operator "before (period)".
  1. Set Amount to 0 and Units to days. This rule checks that the document's expiration date is not older than today.
  1. Save your changes
Notion image

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”
Notion image
 
Did this answer your question?
😞
😐
🤩