Validation Rules allow you to control when a field in your form needs to be filled out a certain way — not just that they have a value, but that the value matches certain conditions that you have added.
Example
Imagine you only want to accept submissions from users with email addresses belonging to your organization.
You can create a validation rule for the Submitter Email field to ensure it contains your organization’s domain (e.g., @droplet.io). If the email doesn’t include your domain, the submission will be flagged as invalid, prompting the user to correct their response before they are able to submit.
Build a Validation Rule
Let's build the email address validation rule together:
Here's how:
In the Form Editor, select a component and click Add validation rule? from the properties panel.
Use the rule builder interface to create one or more conditions. First, select if the conditions will make the field valid or invalid. Then, configure rules as needed.
In our example, we will choose the Submitter Email field, the "contains" operator, and type in "@droplet.io" as the value. This will force all responses in the Submitter Email field to contain the text "@droplet.io".
Press Apply Rule.
Consider previewing or testing your form to ensure that your newly configured validation rule is applying properly.
Advanced Validation Rules
For more advanced validation rules - like character limits or mathematical expressions - you can use Droplet AI to generate a rule expression for you, or write one yourself!
Use Droplet AI to Write Rules
In the same rule builder interface that appears, click Switch to Code in the upper-right corner.
In the top pink input, type in plain language what you would like to be checked for validity.
For example, "only valid when the value includes at least 20 characters"
Press Enter. Droplet AI will think for a few seconds, and then generate a rule expression. Apply the rule and test to ensure it is validating how you intend it to.
Write your Own Rule Expressions
Droplet has a variety of shortcuts (called Helper Functions) to make writing Validate Logic easier. Think of them like Google Sheets or Excel functions. We have a full guide of our helper functions at the link below:
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article