Reputation: 234
I have a server template which I have set maximum length for a field, and ticked 'Has fixed Width'. But when I set values from SDK those formatting are not getting applied. For example, if my server template has length : 10 for a text field, I can populate data via sdk more than 10.
Why is this happening? What I want is apply all the server template configs for tabs and just set values to those tabs via API.
Upvotes: 0
Views: 153
Reputation: 13480
The maxLength value that you specify for a field when creating a Template or Envelope is enforced client-side when a human is using the DocuSign web UI to populate the field. Because this validation is done client-side, it will not be enforced if you're setting the field value via API.
If you want to adhere to the maximum length restriction when setting a field value via the API, you can retrieve the Template via API and examine the maxLength field value for the field (tab) prior to setting that field value via API.
UPDATE #1
To specify a tab value via API that contains multiple lines of text, use \n
in tab's value property anywhere that you want a line break to appear. For example, assume that my Create/Send Envelope request contains the following recipient information:
"recipients": {
"signers": [
{
"name": "John Doe",
"email": "[email protected]",
"roleName": "Signer1",
"recipientId": "72490903",
"tabs": {
"textTabs": [
{
"tabLabel": "field1",
"value": "Line1\nLine2"
}
]
}
}
]
}
By specifying \n
between the strings Line1 and Line2 in the value that's specified for the value property of the text tab, I'm telling DocuSign to insert a line break there. When the recipient views the Envelope, they'll see this for the field:
Upvotes: 1