Hello,
Thank you for reaching out here, we want to welcome you to the Docusign Community, I appreciate you bringing your question to this Community.
I would like to share the following example in which a Custom Field is inserted and establishes predefined values.
printf \
'{
"customFields": {
"textCustomFields": {
"name": "salary",
"required": "false",
"show": "true",
"value": "123000"
}]
},
"documents":
{
"documentBase64": "' > $request_data
cat $doc1_base64 >> $request_data
printf '",
"documentId": "1",
"fileExtension": "docx",
"name": "Lorem Ipsum"
}
],
"emailBlurb": "Sample text for email body",
"emailSubject": "Please Sign",
"envelopeIdStamping": "true",
"recipients": {
"signers": {
"clientUserId": "1000",
"email": "'"${SIGNER_EMAIL}"'",
"name": "'"${SIGNER_NAME}"'",
"recipientId": "1",
"routingOrder": "1",
"tabs": {
"signHereTabs": {
"anchorString": "/sn1/",
"anchorUnits": "pixels",
"anchorXOffset": "20",
"anchorYOffset": "10"
}],
"textTabs": {
"anchorString": "/legal/",
"anchorUnits": "pixels",
"anchorXOffset": "5",
"anchorYOffset": "-9",
"bold": "true",
"font": "helvetica",
"fontSize": "size11",
"locked": "false",
"tabId": "legal_name",
"tabLabel": "Legal name",
"value": "'"${SIGNER_NAME}"'"
}, {
"anchorString": "/familiar/",
"anchorUnits": "pixels",
"anchorXOffset": "5",
"anchorYOffset": "-9",
"bold": "true",
"font": "helvetica",
"fontSize": "size11",
"locked": "false",
"tabId": "familiar_name",
"tabLabel": "Familiar name",
"value": "'"${SIGNER_NAME}"'"
}],
"numericalTabs" :
{
"pageNumber" : "1",
"documentID" : "1",
"xPosition" : "210",
"yPosition" : "235",
"height" : "20",
"width" : "70",
"minNumericalValue" : "0",
"maxNumericalValue" : "1000000",
"validationType" : "Currency",
"bold": "true",
"font": "helvetica",
"fontSize": "size11",
"tabId": "salary",
"tabLabel": "Salary",
"numericalValue": "123000",
"localePolicy" : {
"cultureName" : "en-US",
"currencyCode": "usd",
"currencyPositiveFormat" : "csym_1_comma_234_comma_567_period_89",
"currencyNegativeFormat" : "minus_csym_1_comma_234_comma_567_period_89",
"useLongCurrencyFormat" : "true"
}
}]
}
}]
},
"status": "Sent"
}' >> $request_data
This is the documentation that explains "How to set envelope tab values"
Regards,
Eric | Docusign
Hello @Eric Ruiz , thanks for your response.
I dont have examples of how the JSON should be formatted. But let´s suppose i need to create a tab like this:
"textTabs": s{
"anchorString": "/Custom1/",
"anchorUnits": "pixels",
"anchorXOffset": "5",
"anchorYOffset": "-9",
"bold": "true",
"font": "helvetica",
"fontSize": "size11",
"locked": "false",
"tabId": "legal_name",
"tabLabel": "Legal name",
"value": "test_value"
},
On my template i have a custom field with the label “Custom1” (As showing on the first comment picture), so, if i put that value on “anchorString” property, it should take the reference?, Do i need to do something more?
What if i dont want to specify the anchorX and anchorY and I just want to take the original field positions from the template?
This is an example of what im trying, but still not working (sends the document correctly but doesnt map the value for Custom1 field:
{
"templateId": "xxxxxxxx-4240-4951-bdb1-f43315509f6e",
"templateRoles": t
{
"roleName": "Signer",
"name": "test",
"email": "test@test.com",
"tabs": {
"textTabs": :
{
"anchorString": "/Custom1/",
"bold": "true",
"font": "helvetica",
"fontSize": "size11",
"locked": "false",
"tabId": "Custom1",
"tabLabel": "Legal name",
"value": "test value"
}
]
}
}
],
"status": "sent"
}
Thanks in advance
Hello, thanks for you response @Eric Ruiz.
How can i do a callout to the endpoint using JSON as i do in my code question?
Im trying to use directly the reference of the field im using at the template editor for text customfield.
Instead of using the base64 document i want to do it using the template id, then putting a value for the custom field (Custom1). Is it possible?
Thanks in advance
If you’re using a template, you only need tabLabel and value. Sample payload included.
{
"emailSubject": "Please DocuSign This NDA for ABC Company",
"emailBlurb": "Please let us know if you have any questions.",
"status": "sent",
"templateId": "{{NDA Template}}",
"customFields": {
"textCustomFields": "{
"name": "entityID",
"value": "1234"
}]
},
"templateRoles": "
{
"roleName": "Customer",
"email": "{{Signer Email}}",
"name": "{{Signer Name}}",
"tabs": {
"textTabs": "
{
"tabLabel": "company",
"value": "ABC Company"
}
]
}
}
]
}