In this example, we will be using GlobalPatron data collection forms for a "Product/Warranty Registration" scenario, where customers must supply a valid "Product Serial Number" in order to register their product, and if they supply an invalid serial number we need to reject their submission:
The first step is to create a "Private Data List" to store your list of valid "Product Serial Numbers":
Then we go to our form editor, and open the "Private Logic" module from the right side menu:
This will open a screen where we can define our forms "Private" logic. This is logic that runs securely and privately on the backend server, and is never visible or alterable by the client:
Here we check whether or not the "Product Serial Numbers" data list contains the value that the user has supplied in the "Product Serial Number" field on the form:
And if the user supplied serial number was not found in our list, then we "Block submission", and display a suitable message to the user:
Populating our private "Product Serial Numbers" data list
To populate our list of valid product serial numbers, we can either manually pre-fill them with values using this screen:
Or alternatively, we could have a separate login-protected "Add Product Entry" form built, that on submission adds a new serial number to our private data list. This way the workflow would be that internal staff use the "Add Product Entry" form (which adds serial numbers to the private list), and members of the public would use the "Product Registration" form (which removes serial numbers from the private list).
(Optional) - Preventing the same serial number being registered twice
If it is a business requirement to prevent the same serial number from being registered twice, we can handle that scenario too. Simply create another private data list and call it "Registered Serial Numbers" (we will use this to store all serial numbers which have successfully been registered).
In our forms "Private Logic", we can now add an additional check to see if the user supplied serial number already exists in our "Registered Serial Numbers" list - and if so, block the submission.
Below this check, we also add another set of logic to make sure that all serial numbers get added to the "Registered Serial Numbers" list if they aren't already in the list so that subsequent attempts to register the same serial number will be blocked:
And that's it! We now have a product registration form which requires that users must supply a valid serial number, and also enforces that the same serial number cannot be registered twice.