Juiced Tech
Juiced Tech

Reputation: 129

DocuSign - data validation with tags

I need to create DocuSign envelopes using custom tags with data validation. The value that the recipient enters in the custom tag needs to be validated so that the recipient does not enter the value more than certain value.

I tried using regular expressions but they only validate the entered number for a specific range.

Does DocuSign provide a way to validate the entered number to be less than a specific number?

Upvotes: 3

Views: 711

Answers (1)

Praveen Reddy
Praveen Reddy

Reputation: 7393

You can use the docusign calculated fields for validation.

You can use mathematical signs for inequality, such as greater than or less than, to construct formulas containing an evaluation of the result. For example, if you have a group of fields that must add up to less than or equal to 100, you can use a formula to evaluate the total, and then show a conditional note with a warning to correct the values.

[Field A] + [Field B] + [Field C] <= 100

In your case, since you want the entered number to be less than a specific number, you can show a validation message when [Field A] > {Your Value}

EDIT: This is how the PostEnvelope request will look like. Please notice the three tab types. In the below example, The formula tab will evaluate to 1 when numberTab(Amount) is greater than 100. This will trigger the conditional Note to display the validation message.

{
  "recipients": {
    "signers": [
      { 
        "email": "[email protected]",
        "name": "john smith",
        "recipientId": 1,
        "tabs": 
        {
          "numberTabs": [
            {
              "name": "Amount Tab",
              "required": "true",
              "tabLabel": "Amount",
              "documentId": "1",
              "recipientId": "1",
              "pageNumber": "1",
              "xPosition": "70",
              "yPosition": "119",
              "width": "42",
              "height": "11",
            }
          ],
          "noteTabs": [
            {
              "value": "Amount cannot be more than hundred",
              "name": "Note to recipient",
              "tabLabel": "Validation Message",
              "fontColor": "brightred",
              "documentId": "1",
              "recipientId": "1",
              "pageNumber": "1",
              "xPosition": "132",
              "yPosition": "112",
              "width": "231",
              "height": "20",
              "conditionalParentLabel": "NumberValidation",
              "conditionalParentValue": "1",
              "tabType": "note"
            }
          ],
          "formulaTabs": [
            {
              "formula": "[Amount] >  100",
              "roundDecimalPlaces": "0",
              "name": "Formula Tab",
              "locked": "true",
              "concealValueOnDocument": "true",
              "tabLabel": "NumberValidation",
              "documentId": "1",
              "recipientId": "1",
              "pageNumber": "1",
              "tabType": "formula"
            }
          ]
        }
      }
    ]
  },
  "documents": [
    {
      "documentId": "1",
      "name": "doc.pdf",
      "fileExtension" : "pdf",
      "documentBase64": "{Removed}"
    }
  ],
  "emailSubject": "Testing Validation",
  "status": "sent"
}

Upvotes: 3

Related Questions