DocuSign API - Envelope Checkbox tabs not unique - docusignapi

I'm creating an Envelope signing request using the DocuSign API which includes 2 checkbox tabs. When I view the document after receiving the email when I click on either of the 2 checkboxes it puts a tick in both of them.
The 2 checkboxes appear but clicking either of them marks them both as ticked.
Here's the JSON for the tabs:
"tabs" :
{
"checkboxTabs" :
[
{
"documentId" : "1",
"pageNumber" : "6",
"required" : "true",
"tabId" : "0",
"tabLabel" : "",
"xPosition" : "323",
"yPosition" : "170"
},
{
"documentId" : "1",
"pageNumber" : "6",
"required" : "true",
"tabId" : "1",
"tabLabel" : "",
"xPosition" : "323",
"yPosition" : "184"
}
],
"dateSignedTabs" :
[
{
"documentId" : "1",
"pageNumber" : "6",
"xPosition" : "447",
"yPosition" : "272"
}
],
"signHereTabs" :
[
{
"documentId" : "1",
"pageNumber" : "6",
"xPosition" : "266",
"yPosition" : "231"
}
],
"textTabs" :
[
{
"documentId" : "1",
"pageNumber" : "6",
"tabLabel" : "Name",
"xPosition" : "86",
"yPosition" : "273"
}
]
}
They have unique "tabId" values - not sure what I need to do to make them separate checkboxes that can be ticked/unticked independently.

You'll need to give each checkbox a unique TabLabel. By giving them the same 'empty' TabLabel, you're telling DocuSign that data should populate between them.

Related

DocuSign API Set Signer Language Not Working for First Signer

In my tests so far when creating and sending an envelope using the DocuSign API v2.1 it is not respecting the setting for the supportedLanguage for the first signer, but does for the 2nd signer.
Here's the JSON for Signers array that I'm using:
"signers" :
[
{
"email" : "test#acme.com",
"emailNotification" :
{
"emailBody" : "",
"emailSubject" : "Please Sign the Agreement",
"supportedLanguage" : "de"
},
"name" : "Elisabeth Kiefer",
"recipientId" : "1",
"routingOrder" : "1",
"tabs" :
{
"dateSignedTabs" :
[
{
"anchorIgnoreIfNotPresent" : false,
"anchorString" : "/DateSigned1/",
"anchorUnits" : "pixels",
"anchorXOffset" : "0",
"anchorYOffset" : "0",
"documentId" : "1",
"locked" : "false",
"name" : "Date Signed",
"pageNumber" : "1",
"tabLabel" : "Data Signed",
"value" : ""
}
],
"fullNameTabs" :
[
{
"anchorIgnoreIfNotPresent" : false,
"anchorString" : "/SigName1/",
"anchorUnits" : "pixels",
"anchorXOffset" : "0",
"anchorYOffset" : "0",
"documentId" : "1",
"locked" : "false",
"name" : "Name",
"pageNumber" : "1",
"tabLabel" : "Name",
"value" : ""
}
],
"signHereTabs" :
[
{
"anchorIgnoreIfNotPresent" : false,
"anchorString" : "/Signature1/",
"anchorUnits" : "pixels",
"anchorXOffset" : "0",
"anchorYOffset" : "0",
"documentId" : "1",
"locked" : "false",
"name" : "Sign Here",
"pageNumber" : "1",
"tabLabel" : "Signature",
"value" : ""
}
]
}
},
{
"email" : "test2#random.com",
"emailNotification" :
{
"emailBody" : "",
"emailSubject" : "Please Sign the Agreement",
"supportedLanguage" : "es"
},
"name" : "Fabio Gallego",
"recipientId" : "2",
"routingOrder" : "1",
"tabs" :
{
"dateSignedTabs" :
[
{
"anchorIgnoreIfNotPresent" : false,
"anchorString" : "/DateSigned2/",
"anchorUnits" : "pixels",
"anchorXOffset" : "0",
"anchorYOffset" : "0",
"documentId" : "1",
"locked" : "false",
"name" : "Date Signed",
"pageNumber" : "1",
"tabLabel" : "Data Signed",
"value" : ""
}
],
"fullNameTabs" :
[
{
"anchorIgnoreIfNotPresent" : false,
"anchorString" : "/SigName2/",
"anchorUnits" : "pixels",
"anchorXOffset" : "0",
"anchorYOffset" : "0",
"documentId" : "1",
"locked" : "false",
"name" : "Name",
"pageNumber" : "1",
"tabLabel" : "Name",
"value" : ""
}
],
"signHereTabs" :
[
{
"anchorIgnoreIfNotPresent" : false,
"anchorString" : "/Signature2/",
"anchorUnits" : "pixels",
"anchorXOffset" : "0",
"anchorYOffset" : "0",
"documentId" : "1",
"locked" : "false",
"name" : "Sign Here",
"pageNumber" : "1",
"tabLabel" : "Signature",
"value" : ""
}
]
}
}
]
You can see that the first signer's supportedLanguage is set to "de" and the second signer is set to "es". When I receive the emails for these and view the document only the second signer has the language set for the website and email. The first signer has everything in English and not German as expected.
The language setting is superseded by the user's selected lang that comes from the account.
So, you may want to change the email address to both to some random/unused emails that you know for sure are not part of any account user and check again.
There's no way for you to force the languages of the enduser, they can always overwrite your selection.

Custom message body for each recipient in docusign

I am using a demo account of Docusign integrating with force.com sites using Apex.
I created a template and want to send two different mail body to two different recipient. I have two roles Agent and Broker.
In Broker mail body I want to use Agent Recipient Name. I can get the name in subject by using [[Agent_UserName]] but not in body. Is there any way to use Merge fields in Mail body.
Merge fields are not supported in the email Body.
Here is a sample CreateEnvelope request to send unique Email Subject/Body per recipient. You will have to add the emailNotification property for each recipient
{
"status": "created",
"compositeTemplates": [
{
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"name": "recipient one",
"email": "recipientone#acme.com",
"routingOrder": "1",
"recipientId" : "1",
"roleName" : "texter",
"tabs": {
"textTabs" : [
{
"xPosition" : "100", "yPosition" : "100", "documentId" : "1","pageNumber" : "1"
}
]
},
"emailNotification": {
"emailSubject": "subject for one",
"emailBody": "Body for One",
"supportedLanguage": "en"
}
},
{
"name": "Jane Doe",
"email": "janedoe#acme.com",
"routingOrder": "2",
"recipientId" : "2",
"roleName" : "signer",
"tabs": {
"signHereTabs" : [
{
"xPosition" : "100", "yPosition" : "200", "documentId" : "1", "pageNumber" : "1"
}
]
},
"emailNotification": {
"emailSubject": "subject for two",
"emailBody": "Body for two",
"supportedLanguage": "en"
}
}
]
},
"documents": [
{
"documentId": "1",
"name": "Contract",
"fileExtension": "txt",
"documentBase64": "RG9jIFRXTyBUV08gVFdP"
}
]
}
]
}
]
}

Docusign Rest API CarbonCopy Not Working

I am trying to send a Document for signature using Docusign (Using RestAPI), It has one recipient as a Signer and one as Carbon Copy. I have pasted the JSON below and also I get a success message when calling the Rest API in the demo environment.
However the Recipient designated as CarbonCopy never gets the email, The Signer do recieves the email from Docusign
"emailSubject" : "This is the Subject of the Message",
"emailBlurb" : "This is the Body of the message",
"recipients" : {
"signers" : [ {
"routingOrder" : "1",
"name" : "Signer 1",
"email" : "signer1#gmail.com",
"recipientId" : "1",
"tabs" : {
"signHereTabs" : [ {
"anchorString" : "By:",
"anchorXOffset" : "0",
"anchorYOffset" : "0",
"anchorIgnoreIfNotPresent" : "true",
"anchorUnits" : "inches"
} ]
}
} ],
"carbonCopies" : [ {
"routingOrder" : "2",
"recipientId" : "2",
"name" : "Carbon Copy1",
"email" : "carboncopy1#gmail.com"
} ]
},
"documents" : [ {
"name" : "document.pdf",
"documentId" : "1",
"bytes" : "document Bytes go here - Omitted to make it readable"
} ],
"status" : "sent"
}
Success Message Recieved
{ "envelopeId": "95c0cd64-7b4e-4d98-ad9c-ae74c08cf7f9", "uri": "/envelopes/95c0cd64-7b4e-4d98-ad9c-ae74c08cf7f9", "statusDateTime": "2015-10-19T21:00:30.7100000Z", "status": "sent"}
Yes and I did solve the problem having the carbon copy routing order always higher than the signers, so in the above JSON just reversed the routing order and it worked for me

MongoDB can't get all the rows

I've got a project using the MEAN stack and inside the Mongo DB collection I've got a collection called 'services' with the following rows (a small subset):
{ "_id" : ObjectId("55af611de2be6d817d000001"), "client" : "55a8e5fa586f94752a000002", "collaborators" : null, "date" : ISODate("2015-07-22T09:23:41.917Z"), "latestUpdateDate" : ISODate("2015-07-22T09:23:41.917Z"), "backofficeRequested" : false, "description" : "Uma descrição qq", "wasSeen" : 0, "currentStatusId" : "0", "lastStatusId" : 4, "__v" : 2, "addresses" : [ ], "dates" : [ ], "estimateDuration" : 61, "estimatePrice" : "55", "notes" : [ ], "serviceDate" : ISODate("2015-07-23T10:07:00Z"), "totalPrice" : "600", "serviceInvoiced" : "No", "evaluation" : "", "positiveFeatures" : "", "negativeFeatures" : "" }
{ "_id" : ObjectId("55afa8662c1e98c80d2fd2ff"), "client" : "55a8e5fa586f94752a000002", "estimatePrice" : "12", "estimateDuration" : NumberLong(720), "description" : "12", "serviceDate" : ISODate("1212-12-12T12:48:45Z"), "lastStatusId" : null, "currentStatusId" : "0", "collaborators" : [ { "id" : "55acb6022c1e98d05f2fd2ff" } ], "dates" : [ ], "totalPrice" : "", "backofficeRequested" : NumberLong(0), "serviceInvoiced" : "No", "evaluation" : "", "positiveFeatures" : "", "negativeFeatures" : "" }
{ "_id" : ObjectId("55afa9f62c1e98370e2fd2ff"), "client" : "55ae68d82c1e98ac782fd303", "estimatePrice" : "12", "estimateDuration" : NumberLong(720), "description" : "12", "serviceDate" : ISODate("1212-12-12T12:48:45Z"), "lastStatusId" : null, "currentStatusId" : "1", "collaborators" : [ { "id" : "55acb6022c1e98d05f2fd2ff" } ], "dates" : [ ], "totalPrice" : "500", "backofficeRequested" : NumberLong(0), "serviceInvoiced" : "No", "evaluation" : "", "positiveFeatures" : "", "negativeFeatures" : "" }
{ "_id" : ObjectId("55afaa7e2c1e98bc0d2fd2ff"), "client" : "55a8e5fa586f94752a000002", "estimatePrice" : "12", "estimateDuration" : NumberLong(720), "description" : "12", "serviceDate" : ISODate("1212-12-12T12:48:45Z"), "lastStatusId" : null, "currentStatusId" : "0", "collaborators" : [ { "id" : "55acb6022c1e98d05f2fd2ff" } ], "dates" : [ ], "totalPrice" : "", "backofficeRequested" : NumberLong(0), "serviceInvoiced" : "No", "evaluation" : "", "positiveFeatures" : "", "negativeFeatures" : "" }
{ "_id" : ObjectId("55afaf582c1e98d80d2fd303"), "client" : "55ae68d82c1e98ac782fd303", "estimatePrice" : "1", "estimateDuration" : NumberLong(60), "description" : "1", "serviceDate" : ISODate("1111-11-11T11:47:45Z"), "lastStatusId" : null, "currentStatusId" : "4", "collaborators" : [ { "id" : "55ae40772c1e98007a2fd2ff" } ], "dates" : [ ], "totalPrice" : "", "backofficeRequested" : NumberLong(0), "serviceInvoiced" : "No", "evaluation" : "", "positiveFeatures" : "", "negativeFeatures" : "" }
{ "_id" : ObjectId("55afb8472c1e98370e2fd300"), "client" : "55a8e5fa586f94752a000002", "estimatePrice" : "1", "estimateDuration" : NumberLong(60), "description" : "1", "serviceDate" : ISODate("1111-11-11T11:47:45Z"), "lastStatusId" : null, "currentStatusId" : NumberLong(2), "collaborators" : [ { "id" : "55ae40772c1e98007a2fd2ff" } ], "dates" : [ ], "totalPrice" : "", "backofficeRequested" : NumberLong(0), "serviceInvoiced" : "No", "evaluation" : "", "positiveFeatures" : "", "negativeFeatures" : "" }
{ "_id" : ObjectId("55aff2dc2c1e98ac112fd2ff"), "client" : "55a8e5fa586f94752a000002", "estimatePrice" : "1", "estimateDuration" : NumberLong(720), "description" : "1", "serviceDate" : ISODate("1989-12-12T12:12:00Z"), "lastStatusId" : null, "currentStatusId" : NumberLong(2), "collaborators" : [ { "id" : "55ae40772c1e98007a2fd2ff" } ], "dates" : [ ], "totalPrice" : "", "backofficeRequested" : NumberLong(0), "serviceInvoiced" : "No", "evaluation" : "", "positiveFeatures" : "", "negativeFeatures" : "" }
I want to get all the rows belonging to the client with the ID "55a8e5fa586f94752a000002".
It's pretty easy to do in the mongo Shell:
db.services.find({"client":"55a8e5fa586f94752a000002"})
But I am having a hard time inside Node.js because it either returns no services at all or it ends up returning just one service.
Here's what I'm using right now:
(...)
console.log(checkDatas[0]._id);
Service.find().where('client', checkDatas[0]._id)
.exec(function(err, services)
{
console.log("output: " + services);
(...)
And finally, here's the output:
**55a8e5fa586f94752a000002**
**output**: { _id: 55aff719af19b58913000001,
client: 55a8e5fa586f94752a000002,
__v: 1,
collaborators: [ { id: '55acb6022c1e98d05f2fd2ff' } ],
notes: [],
dates: [],
addresses: [],
date: Wed Jul 22 2015 22:03:37 GMT+0200 (CEST),
latestUpdateDate: Wed Jul 22 2015 22:03:37 GMT+0200 (CEST),
backofficeRequested: false,
totalPrice: null,
estimatePrice: null,
estimateDuration: null,
description: '',
serviceDate: null,
wasSeen: 0,
currentStatusId: 3,
lastStatusId: 1 }
It's as if I were using findOne but I'm not.
On top of that, yesterday I had a .sort() method also in that query and things worked fine after commenting it but today the problem's back.
Do MongoDB / Node have some sort of caching system I'm not aware of?
Thanks
EDIT:
Running
Service.find({'client': checkDatas[0]._id})
yields the same result
It looks like you're mixing ObjectId's and strings, which are two different things.
Your Mongoose query is looking for an ObjectId:
Service.find().where('client', checkDatas[0]._id)
Quick tip: you can distinguish both types in the output:
// ObjectId, because it doesn't have quotes around it
client: 55a8e5fa586f94752a000002
// String
collaborators: [ { id: '55acb6022c1e98d05f2fd2ff' } ]
Your MongoDB shell query is looking for a string:
db.services.find({"client":"55a8e5fa586f94752a000002"})
The subset you're posting shows only strings, but I think that your database may actually contain both types. You can check and see if this works better:
Service.find().or([
{ client : checkDatas[0]._id },
{ client : String(checkDatas[0]._id) }
])...
Obviously this isn't ideal, you should consider normalizing your database if both types are mixed.
EDIT: the or query probably won't work when using Mongoose, since it will cast both clauses to the type defined in the schema. You can still check from the Mongo shell:
db.services.find({ $or : [
{ client : "55a8e5fa586f94752a000002" },
{ client : ObjectId("55a8e5fa586f94752a000002") }
]})

combine multiple documents in a couchdb view

In couchdb, I need to represent some data in the following format, a outer container that references other documents inside an array.
I want to keep these documents separate as I need to manage conflicts on them individually.
{
"_id" : "1"'
"type" : "container",
"items" : [ "1", "2", "3"]
}
{
"_id" : "2",
"value": "a"
"type" : "item"
}
{
"_id" : "3",
"value": "b"
"type" : "item"
}
{
"_id" : "4",
"value": "c"
"type" : "item"
}
I want to output a view of the data in the following format.
{
"_id" : "1"'
"type" : "container",
"items" : [
{
"_id" : "2",
"value": "a"
"type" : "item"
},
{
"_id" : "3",
"value": "b"
"type" : "item"
},
{
"_id" : "4",
"value": "c"
"type" : "item"
}
]
}
Whats the best way to approach this?
You can achieve this using couchdb linked documents
here is how the view will look like
function(doc){
if(doc.items)
doc.items.forEach(function(item){
emit(doc._id,{_id:item});
})
}
now you can query the view with include_docs=true parameter and you should have the desired result.

Resources