DocuSign | Radiobuttons and Checkboxes - json

How does it look like in JSON if I want to have radio buttons for Yes / No,
Then if one answers Yes,
a checkbox on the Telephone / Email / Mobile shall be prompted?
SEE IMAGE HERE: https://i.stack.imgur.com/gvLuV.png
Here is how I am seeing it, but not sure if correct:
"checkboxTabs": [
{
"conditionalParentLabel": "RADIOGROUP",
"conditionalParentValue": "Yes_1",
"anchorString": "\\XL1\\",
"tabLabel": "Landline",
"tabGroupLabels": [
"checkboxgroup1"
]
},
{
"conditionalParentLabel": "RADIOGROUP",
"conditionalParentValue": "Yes_1",
"anchorString": "\\XE1\\",
"tabLabel": "Email",
"tabGroupLabels": [
"checkboxgroup1"
]
},
{
"conditionalParentLabel": "RADIOGROUP",
"conditionalParentValue": "Yes_1",
"anchorString": "\\XM1\\",
"tabLabel": "Mobile",
"tabGroupLabels": [
"checkboxgroup1"
]
}
],
"radioGroupTabs": [
{
"groupName": "RADIOGROUP",
"radios": [
{
"anchorString": "\\XY1\\",
"value": "Yes_1"
},
{
"anchorString": "\\XN1\\",
"value": "No_1"
}
]
}
]

You can do this with conditional fields. You would need to set the conditionalParentLabel and conditionalParentValue fields on the checkbox tabs so that the value for conditionalParentLabel matches the value for tabLabel in the parent tab. In this case the parent tab is the radio button. You would also need to set conditionalParentValue to "on." There is an example of what this json would look like here https://developers.docusign.com/docs/esign-rest-api/esign101/concepts/tabs/conditional-fields/

Related

How to create DataTable based on dynamic row and columns list?

I want to create Grid using DataTable JQuery. Here I will have dynamics columns that means I don't have predefined columns. Normally, when I have predefined columns, I just create Table and apply ToDataTable() method to convert in DataTable. But here I will have dynamic columns. One way is to iterate through columns and create Table Cell. Is there any other easy way?
Here is example,
{
"Rows": [
{
"Columns": [
{
"DisplayName": "First Name",
"Value": "Ema",
},
{
"DisplayName": "Last Name",
"Value": "Sherik",
}
{
"DisplayName": "Status",
"Value": "Active",
}
]
},
{
"Columns": [
{
"DisplayName": "First Name",
"Value": "Jack",
},
{
"DisplayName": "Last Name",
"Value": "Mark",
},
{
"DisplayName": "Status",
"Value": "Active",
}
]
},
],
"TotalRows": 2,
}

How do I filter elements from a list correctly with JMESPath and Ansible?

I have the following structure.
[
{
"ami_launch_index": 0,
"architecture": "x86_64",
"instance_type": "t2.micro",
"monitoring": {
"state": "disabled"
} ,
"placement": {
"availability_zone": "eu-central-1a",
"group_name": "",
"tenancy": "default"
},
"tags": {
"Name": "MYNAME 1",
"Project": "MY PROJECT",
"Purpose": "MYTEST"
},
"virtualization_type": "hvm"
},
{
"ami_launch_index": 2,
"architecture": "x86_64",
"instance_type": "t2.micro",
"monitoring": {
"state": "disabled"
},
"placement": {
"availability_zone": "eu-central-1a",
"group_name": "",
"tenancy": "default"
},
"tags": {
"Name": "MYNAME 2",
"Project": "MY SECOND PROJECT",
"Purpose": "WHY THE HECK NOT"
},
"virtualization_type": "hvm"
}
]
I want to print all elements where [].tags.Name contains the string "SECOND" (so just the second element. How do I achieve this?
This is what I've tried, but it's not working.
- debug:
msg: "{{ instances.stdout | from_json | json_query(\"[][?contains(tags.Name, 'SECOND')]\") }}"
I tried using http://jmespath.org but can't extract the data the way I want either.
To fetch items that has SECOND in tags.Name you can use this query:
[?contains(tags.Name,'SECOND')]
But it seems that your sample data will not match anything, as SECOND is only in Project property and not Name.

Getting an API generated in-person signing envelope tracked through Salesforce Connect

I'm using the rest API to create an in person signing session from salesforce. My envelope creation json is like this:
{
"documents": [{
"documentBase64": "'+base64EncodedDocToSign+'",
"documentId": "1",
"fileExtension": "pdf",
"name": "contract.pdf"
}
],
"emailSubject": "Please Sign",
"recipients": {
"inPersonSigners": [{
"email": "some#gsome.com",
"name": "Luis",
"hostEmail": "some#gsome.com",
"hostName": "Luis",
"signerEmail": "other#gother.com",
"signerName": "Charles",
"recipientId": "1",
"tabs": {
"signHereTabs": [{
"anchorString": "s1",
"anchorXOffset": "0",
"anchorYOffset": "0",
"anchorIgnoreIfNotPresent": "false",
"anchorUnits": "inches"
}
]
},
"routingOrder": "1",
"clientUserId": "1000",
"embeddedRecipientStartURL": "SIGN_AT_DOCUSIGN",
}
]
},
"status": "sent"
}
The next step would be for the object to be tracked using Connect. Connect is properly configured for the object and works if I "Sign with Docusign" or use a custom button.
I understand I must change the json to include the DSFSSourceObjectId custom field, with value equal to the Id of the object that is originating the request, but if I try to get a customField in there the json is not properly formatted anymore.
I tried adding the customField like:
...
}
]
},
"customFields": [
{
"Name": "DSFSSourceObjectId",
"Value": "' + objectId + '"
}
],
"status": "sent"
}
Is this viable?
I got this working adding the following to the JSON:
"customFields": {
"textCustomFields": [{
"value": "salesforceId",
"required": "false",
"show": "false",
"name": "DSFSSourceObjectId"
}
]
},

Create DocuSign Envelope with Custom Fields

I am trying to add custom fields at the envelope level via the REST API and cannot get the values to be retained. The custom fields have been defined in the UI and come over in the envelope, but without the value that was assigned. If I add a custom field that was not defined in the UI, then it does not come over at all.
If I add the new custom field in a second call after the envelope is initially created, it will work, but that seems extraneous. What am I doing wrong?
Here is the JSON for creating a new custom field in the envelope:
{
"emailSubject": "Please Print, Complete and Sign Document",
"emailBlurb": "Please print and complete documents and sign on paper. ",
"status": "sent",
"customFields": {"textCustomFields":[{"name":"MyOwnField","required":"true","show":"true","value":"MyValue"}]},
"compositeTemplates": [{
"inlineTemplates": [{
"sequence": "1",
"recipients": {
"signers": [{
"requireSignOnPaper": "true",
"name":"Millard Fillmore",
"email":"dgilbert#firstallied.com",
"recipientId": "1",
"routingOrder": "1"
}]
}
}],
"document":
{
"documentId": "1",
"name": "Corestone Account Application.pdf",
"transformPdfFields": false
}
}]
}
The customFields object needs to be located inside the inlineTemplate object. Try this instead:
{
"emailSubject": "Please Print, Complete and Sign Document",
"emailBlurb": "Please print and complete documents and sign on paper. ",
"status": "sent",
"compositeTemplates": [{
"inlineTemplates": [{
"sequence": "1",
"customFields": {
"textCustomFields": [{
"name": "MyOwnField",
"required": "true",
"show": "true",
"value": "MyValue"
}]
},
"recipients": {
"signers": [{
"requireSignOnPaper": "true",
"name": "Millard Fillmore",
"email": "dgilbert#firstallied.com",
"recipientId": "1",
"routingOrder": "1"
}]
}
}],
"document": {
"documentId": "1",
"name": "Corestone Account Application.pdf",
"transformPdfFields": false
}
}]
}

Getting TAB_PAGENUMBER_IS_NOT_IN_DOCUMENT despite not using any page numbers

I am making a POST request to /v2/accounts/<account_id>/envelopes. Here is the error I am getting:
{
"errorCode": "TAB_PAGENUMBER_IS_NOT_IN_DOCUMENT",
"message": "The pagenumber specified in the tab element is not in the document that the tab refers to. Tab on Page 2 of Document 3 for Recipient 1"
}
Normally this request contains some text tabs and checkbox tabs, none of these tabs refer to any page. We only specify name, tabLabel & value for text tabs and name, tabLabel & selected for checkboxes. But I get the same error even when I send no tab data.
Here is the request JSON:
{
"allowMarkup": false,
"allowReassign": false,
"allowRecipientRecursion": false,
"asynchronous": false,
"authoritativeCopy": false,
"autoNavigation": false,
"brandId": "",
"compositeTemplates": [{
"inlineTemplates": [{
"sequence": "2",
"recipients": {
"signers": [{
"accessCode": null,
"clientUserId": "123456",
"email": "EMAIL_1",
"emailNotification": null,
"name": "Atamert Olcgen",
"recipientId": "1",
"roleName": "Signer",
"tabs": {
"checkboxTabs": [
],
"radioGroupTabs": [
],
"textTabs": [
]
}
}]
}
}, {
"sequence": "3",
"recipients": {
"signers": [{
"accessCode": null,
"clientUserId": "123456",
"email": "EMAIL_1",
"emailNotification": null,
"name": "Atamert Olcgen",
"recipientId": "1",
"roleName": "Signer",
"tabs": {
"checkboxTabs": [
],
"radioGroupTabs": [
],
"textTabs": [
]
}
}]
}
}],
"serverTemplates": [{
"sequence": "2",
"templateId": "SECOND_TEMPLATE_ID"
}, {
"sequence": "3",
"templateId": "THIRD_TEMPLATE_ID"
}]
}],
"customFields": null,
"emailBlurb": "",
"emailSubject": "Email Subject",
"enableWetSign": false,
"enforceSignerVisibility": false,
"envelopeIdStamping": false,
"eventNotification": null,
"signingLocation": "Online",
"status": "sent",
"templateId": "FIRST_TEMPLATE_ID",
"templateRoles": [{
"accessCode": null,
"clientUserId": "123456",
"email": "EMAIL_1",
"emailNotification": null,
"name": "Atamert Olcgen",
"recipientId": "1",
"roleName": "Signer",
"tabs": {
"checkboxTabs": [
],
"radioGroupTabs": [
],
"textTabs": [
]
}
}, {
"accessCode": null,
"clientUserId": null,
"email": "EMAIL_2",
"emailNotification": null,
"name": "COMPANY_NAME",
"recipientId": "2",
"roleName": "COMPANY_NAME",
"tabs": {
"checkboxTabs": [
],
"radioGroupTabs": [
],
"textTabs": [
]
}
}]
}
I have prettyprinted and redacted some fields but otherwise this is the exact same JSON we're sending.
Why are we getting an error about page number even though we're not specifying any pages, even when we're not specifying any tabs at all?
In the DocuSign platform there are two ways of specifying tab locations, through absolute positioning using x and y coordinates or through what's known as Anchor Tagging, which places tabs based on document content. If you are making a POST request to the uri
/v2/accounts/<account_id>/envelopes
and you are setting the status to Sent instead of creating a draft by setting status to Created, then the that means you are sending a signature request and you need to have tab information filled out for all your tabs. That's why you get the error even when you are not setting any tabs in your request.
In terms of why you are getting the missing page number error, since you are using absolute positioning by setting the x and y coordinates you need to also specify on which page you are placing them. If you were using Anchor Tagging then you would not need to set the page numbers. So basically the ways you can set your tabs up are like this:
-- Absolute positioning --
"signHereTabs": [
{
"xPosition": "100",
"yPosition": "100",
"documentId": "1",
"pageNumber": "1"
}
]
-- Anchor Based Positioning --
"signHereTabs": [
{
"anchorString": "Please Sign Here:",
"anchorXOffset": "1",
"anchorYOffset": "0.5",
"anchorIgnoreIfNotPresent": "false",
"anchorUnits": "inches"
}
]