问题
From Docusign Web UI, I am able to add a checkbox Group and add a validation like this:
But same validation is not available from any of the API. Is there any workaround or some other API endpoint to add this validation?
回答1:
This is available through the API. The trick is that you have to set each Checkbox to have a Group, and then you have to assign the validation rules to the TabGroup. Here's an example:
"tabs": {
"checkboxTabs": [
{
"tabLabel": "Checkbox1",
"required": false,
"selected": false,
"pageNumber": 1,
"documentId": "1",
"recipientId": "1",
"tabGroupLabels": [
"Checkbox Group"
],
"xPosition": 308,
"yPosition": 43,
},
{
"tabLabel": "Checkbox2",
"pageNumber": 1,
"documentId": "1",
"recipientId": "1",
"tabGroupLabels": [
"Checkbox Group"
],
"xPosition": 308,
"yPosition": 59,
}
],
"tabGroups": [
{
"groupLabel": "Checkbox Group",
"locked": false,
"groupRule": "SelectAtLeast",
"minimumRequired": 1,
"maximumAllowed": 1,
"validationMessage": "Please check a box",
"documentId": "1",
"pageNumber": 1,
"tabScope": "Document",
"recipientId": "1"
}
]
}
To get an idea of how exactly to set up the group to have the validation rules you want, you might use API logging to capture the Web Console's AddEnvelopeTabs traffic. Do note that the web console uses two API calls (one to create the checkboxes, one to create the group), but your application can do it in one.
Added
The possible groupRule
values are SelectAtLeast
, SelectAtMost
, SelectExactly
, SelectARange
. Use the value that fits your use case.
The associated attributes are minimumRequired
, maximumAllowed
, as appropriate to the groupRule
setting.
Internal Jira DEVDOCS-2087 has been filed to have the docs updated.
回答2:
See this article - https://support.docusign.com/en/articles/How-do-I-use-muiltiple-checkboxes-with-at-least-one-required It explains how to do this in details you need to be creating a text tab for each checkbox and add conditional logic etc. Not easy stuff, but doable
来源:https://stackoverflow.com/questions/58209376/checkbox-validation-using-docusign-rest-api