Although DocuSign allows you to validate certain fields such as requiring only numbers or only letters, even with custom validation it does not allow you to validate across multiple fields. An example of when this is would be helpful is on some forms a certain group of boxes may be when certain fields are required to add up to a certain amount (such as percentages that must add up to 100). You can use tooltips and alert messages to remind the signer, but these will not stop them from completing the form if they made a mistake. We will use percentages that must
Let us say that you have three text fields and you want the signer to input values that add to 100 as an example.
First, you want to create two formulas, one that adds up the percentages and another that checks to see if that total is equal to 100. The second formula will evaluate to 0 when the total is not 100, and 1 when the total is 100.
...
a formula field that adds all the values together:
[X] + [Y] + [Z] = 100
By specifying within the formula that the sum equals 100, you are essentially turning this formula field into a binary expression. When the expression is true (X + Y + Z = 100), then the formula returns a value of 1. When the expression is false (X + Y + Z ≠ 100), the formula returns a value of 0. You can format this field to use white text so it will not be visible to the signer.
Note: If you want to display the added total to the signer as they enter new values, use a different formula field that has just [X] + [Y] + [Z] (X, Y and Z being the percentage fields)
Formula2: [Formula1] = 100
Now the trick is to create a field that will always be invalid no matter what value is entered and make that field appear when the second formula equals 0 (meaning that the total does not add up to exactly 100).
In order to make the field impossible to fill out, you must create a duplicate field, giving it the same data label as the original and making it invisible (Read Only and white text). You can then give the two fields mutually exclusive custom validations. For example, you can make the first accept only digits 0-4 and the second digits 5-9.
Regex pattern. This display formula should not be used in the following logic.
Next, you must turn the formula field into a trigger and create conditions that make it impossible for the signer to complete the form until the expression is made true (X + Y + Z = 100). To do so, you need to create two new required text fields, assign them the exact same data label, give them conflicting validations, and make them conditional to the formula field (make these fields appear when trigger = 0).
In order to create conflicting validations, you need to select Custom Validation and use a regex pattern. The example below only accepts digits 0-4 in the first field and digits 5-9 in the second.
Regex pattern 1: ^(0-4)
Regex Pattern 2: ^(5-9)
You can also customize Validations also allow you to edit the error message to remind the signer of the problem they must fixthat will appear when the wrong digit is used.
Since the fields have the same data label, any value typed in one will automatically appear in the other, making it impossible to satisfy both validations. This forces the user signer to fix the issue in order to make the warning and field to disappear, satisfy the formula expression, making the conflicting fields disappear and allowing them to complete the form.
Important Note: You can format the fields to have white, small text limited to 1 character, but since the fields are required the red outline will still be visible on the form.
Example:
*arrow represents conditional rule pointing from trigger to field to appear
**blue text represents custom validation
...