I’m trying to send a DocuSign template with conditional tabs. Through the UI/web portal, it sends fine. Via the API, it errors with this response from DocuSign:
CONDITIONALTAB_HAS_INVALID_PARENT
– A conditional tab references an invalid parent. Parent label must match another tab. Only one parent allowed. Signature tabs may not be parent tabs. Child tab with label: sig-spanish has an invalid parent.
We’ve boiled our template’s conditional tabs down to just a radio group with 2 radio buttons as the parent, and 2 signature fields that are conditional on corresponding radio buttons:
Inspecting our call to DocuSign (via the createEnvelope()
method), here is how those fields are being sent:
[
{
roleName: "primary",
tabs: {
radioGroupTabs: [
{
documentId: "1",
groupName: "radio-group1",
originalValue: "Spanish",
radios: [
{
bold: "false",
font: "calibri",
fontColor: "black",
fontSize: "size10",
italic: "false",
locked: "false",
pageNumber: "1",
required: "true",
selected: "true",
tabId: "d032aff1-ecbd-4d51-bce2-c0fd4225ecbf",
underline: "false",
value: "Spanish",
xPosition: "171",
yPosition: "247",
},
{
bold: "false",
font: "calibri",
fontColor: "black",
fontSize: "size10",
italic: "false",
locked: "false",
pageNumber: "1",
required: "true",
selected: "false",
tabId: "a45319cb-d98c-42d2-942f-3a77202ee7e1",
underline: "false",
value: "English",
xPosition: "170",
yPosition: "326",
},
],
recipientId: "72120635",
requireAll: "false",
requireInitialOnSharedChange: "false",
shared: "false",
tabType: "radiogroup",
templateLocked: "false",
templateRequired: "false",
value: "Spanish",
},
],
signHereTabs: [
...
{
conditionalParentLabel: "radio-group1",
conditionalParentValue: "Spanish",
documentId: "1",
name: "SignHere",
optional: "false",
pageNumber: "1",
recipientId: "72120635",
scaleValue: "1",
stampType: "signature",
tabId: "65bef1a3-4cd3-4ff7-8d2b-80a57fc1fbd3",
tabLabel: "sig-spanish",
tabType: "signhere",
templateLocked: "false",
templateRequired: "false",
tooltip: "SignHere",
xPosition: "254",
yPosition: "242",
},
{
conditionalParentLabel: "radio-group1",
conditionalParentValue: "English",
documentId: "1",
name: "SignHere",
optional: "false",
pageNumber: "1",
recipientId: "72120635",
scaleValue: "1",
stampType: "signature",
tabId: "e027af5d-32e5-4b15-9b8d-8d721f0de470",
tabLabel: "sig-english",
tabType: "signhere",
templateLocked: "false",
templateRequired: "false",
xPosition: "253",
yPosition: "316",
},
],
textTabs: [
...
],
},
email: "[email protected]",
name: "Test",
clientUserId: "[email protected]",
embeddedRecipientStartURL: "SIGN_AT_DOCUSIGN",
},
]
This, as far as I can tell, follows the official documentation on setting up conditional tabs. There is additional documentation that does mention a couple things:
Which types you are allowed to use for Parent conditional fields differ between the UI and the API. In the UI, you can use only the following tab types to trigger revealing conditional fields:
- Checkbox
- Radio button
- Dropdown
- Text
In the API, you can use any field type as a Parent field if you set its optional property to true.
Emphasis mine. This seems to imply that parent fields set via the API need optional: 'true'
. However, I’ve tried setting that without any change. I believe the documentation means for any types that the UI doesn’t accept, the optional property has to be set to ‘true’.
Additionally, those docs specify:
If the conditional field is a Checkbox tab or button from a Radio Group tab, use
on
as the value to show that the parent tab is active.
However, after investigating, this doesn’t even make sense for radio buttons.
Things I’ve tried:
- Setting
optional: 'true'
on the parents (as noted above) - Setting
optional: 'true'
on the child fields (maybe the docs were wrong) - Trying checkboxes instead
- Removing all but one conditional child tab and one parent
- Combinations of the above
2
Answers
After quite a while, I figured out the issue.
As part of the
createEnvelope()
call, theEnvelopeDefinition
takes atabs
parameter, where you can prefill the values of matching fields in the template.Turns out if you are also including tabs (at least, signature tabs) that are conditional in the template, it blows up.
We were retrieving all tabs from the template, filling in values for just some of them, then sending all of them as part of the
EnvelopeDefinition
.The solution was to only send over the tabs that we had values to set (so basically just the text tabs).
I tried to do what you’re looking for with the following JSON and it worked. Just a disclaimer, I wasn’t using a template and just included this in the envelope definition when creating a new envelope. You shouldn’t need to worry about the
optional
setting because you’re using a radio group as your conditional parent. I would suggest removing some of the extra fields that you’ve included in your JSON to see if it works with a simplified request like what I have below. Then you can add fields back as needed to try to determine which one might be the problem.