What is Duplicate Value Validation?
This guide uses an Order Management scenario to illustrate how to configure duplicate value validation for related form fields, ensuring that no duplicate products can be added to a single order. In other words, each order’s related Order Details records must have unique products.
How to Design It?
As outlined above, the goal is to validate duplicates across multiple Order Details records linked to the same Order. Depending on the data entry method, the validation approach falls into two situations:
Situation 1: Entering Master Form and Related Form Data Simultaneously
Scenario: When creating a new order (master form record) and its order details (related form records) at the same time.
Validation: Enable the "Duplicate values are not allowed when filling in a single record" setting for the related form field.
Situation 2: Adding or Editing Related Form Data Separately
Scenario: When the order (master form record) already exists, and order details (related form records) are added or edited separately.
Validation: Add an auxiliary field that combines Order Name + Product Code to uniquely identify each order detail. Then set "No duplicates" for this field.
Note:
The "No duplicates" setting on the related form field does not take effect.
What Does It Look Like?
When entering a record in the Order form, if duplicate products are added in the Order Details, submission will not be allowed.
When adding or editing Order Details separately, if a product code duplicates existing data, adding the new entry will be disallowed.
Prerequisite
This setup involves three forms:
Order: Captures order-level information and is linked to the Order Details Form via a related form field.
Order Details: Records order item details and references the Product Info Form for product data.
Product Info: Stores basic product information.
How to Set it up?
Step 1 Configuring the Order Details
To ensure the uniqueness of each order’s item details, we add an auxiliary field in Order Details. We go to the form design page and click the Related Order field (Lookup field). In Field Properties > Data Filling, select a master form field and fill it into the current form as the order’s unique identifier (e.g., Order Name).
Note:
Do not use the Serial No. as the unique identifier, because during simultaneous entry, this value is not yet available for the related form.
Click the Related Product field, select the Product Code field as the unique identifier, and fill it into the current form.
Add a Single Line field named Duplicate Check Helper and set:
Formula:
CONCATENATE(Order Name, Product Code)
Validation: No duplicates
Field Permissions: uncheck View.
In Form Properties, set Hidden Field Default Value as Always Recalculate.
Step 2 Configuring the Related Form Field
Go to the design page of the Order form and click the Order Details field. In Field Properties > Data Filling, set as follows:
Display Fields: select Product Code.
Data Permission: enable Duplicate values are not allowed when filling in a single record.
Select Product Code as the field to validate for duplicates.