Send envelope - replacing multiple template documents - docusignapi

I have a question regarding the following scenario.
I have a Docusign template with 2 documents. Template contains two Template Roles with few signature tags applied on documents. There could be also Text Input tags, checkbox tags etc...
What I need is to send an envelope with documents that will replace both template documents but to apply DocuSign tags (signature, checkbox..) that were configured in the template, to apply document visibility, and as much DS template features as it can.
Signature request (envelope) is sent using DocuSign.eSign C# client library.
I'm using following code that builds Composite Template that contains two new documents with appropriate documentIDs retrieved from DocuSign template.
EnvelopeDefinition envDef = new EnvelopeDefinition();
envDef.EmailSubject = "Subject";
envDef.EmailBlurb = "Body";
envDef.CompositeTemplates = new List<CompositeTemplate>();
envDef.CompositeTemplates.Add(new CompositeTemplate
{
ServerTemplates = new List<ServerTemplate> {
new ServerTemplate
{
Sequence = "2",
TemplateId = "TEMPLATE_ID_GOES_HERE"
}
},
InlineTemplates = new List<InlineTemplate>
{
new InlineTemplate
{
Sequence = "1",
Documents = new List<DocuSign.eSign.Model.Document>
{
new Document
{
DocumentBase64 = "...", //document content
Name ="some.pdf",
DocumentId = "TEMPLATE_DOC1_ID_GOES_HERE" //ID of template document that should be replaced
},
new Document
{
DocumentBase64 = "...", //document content
Name ="another.pdf",
DocumentId = "TEMPLATE_DOC2_ID_GOES_HERE" //ID of template document that should to be replaced
}
}
}
}
});
Envelope is successfully sent, signers can see both new documents, but there are no Tags that were configured in the Template (on Docusign Web UI), and I'd like to avoid sending recipient tabs from client.
Am I missing something?
Thanks.

Change the sequencing order so the new documents are listed first.
With composite templates, order matters. For documents, the earlier documents are used. -- So your new documents should be before the server template (and its documents).
For everything else, the later information wins.
See this answer: https://stackoverflow.com/a/44376770/64904
On second thought, I see that you're doing this and it is all working except that the tabs are not being applied to the new documents.
Try the merge_roles_on_draft query parameter. Also, if you're using anchor tabs, add the applyAnchorTabs: 'true' element to the document objects.

Related

Get SharePoint item from document library based on custom metadata

I am storing metadata with my documents and folders in SharePoint. This metadata includes an itemid which is a unique identifier from the system it came from. Is there a way to retrieve the item from SharePoint using Graph API by specifying the itemid in the metadata?
This query works for properties that Microsoft provides like name:
https://graph.microsoft.com/v1.0/sites/{siteid}/drive/root/children?$filter=name eq 'Z'
But if I try it with the custom property then I simply get an empty result:
https://graph.microsoft.com/v1.0/sites/{siteid}/drive/root/children?$filter=itemid eq 'Z'
Is there a way to query documents and folders with custom properties like this?
Here is the code used to update the field on the document in SharePoint using Graph API:
public FieldValueSet UpdateListItem(string siteId, string driveId, string fileItemId, Dictionary<string, object> additionalData)
{
var updateFileTagsRequest = graphClient.Sites[siteId].Drives[driveId].Items[fileItemId].ListItem.Fields.Request();
var fieldValueSet = new FieldValueSet { AdditionalData = additionalData };
var result = updateFileTagsRequest.UpdateAsync(fieldValueSet).Result;
return result;
}
The dictionary values being passed to the UpdateListItem method are strings and look like this: "ItemId", "A unique value"

To add a list of Strings to Lucene document

Suppose I've a field which is a List (Say : "Key" : ["value1", "value2", "value3"]. How do add it to a lucene document in a sequence map. I'm currently loading the content from a file in a sequence and mapping each entry to a document and for each entry adding the document using index writer.
seq(items)
.map(item -> {
Document document = new Document();
document.add(new TextField("field", item.field(), Field.Store.YES));
return document;
})
.forEach(consumer(indexWriter::addDocument));
I'm not struggling to add a field which is a list of strings to the above index document. Can someone please help ?
You don't need to create a document per value in that field but conversely, using the same document you just use document.add(<field>) for each value of the list (provided that field is defined as multivalued) :
Document document = new Document();
seq(items).map(item -> {
document.add(new TextField('field', item.field(), Field.Store.YES));
});
yourIndexWriter.addDocument(document);

Assign signers to Radio group via pdf form field transformations in docusign rest api

I have a PDF with form fields that I have to upload to docusign via the rest api.
I'm using the PDF form field transformation to transform the PDF fields in to Signature fields and assign them to signers by using wild card labels via composite templates as below.
This works fine for Signature and Date fields but I can't figure out how to assign radio button groups to signers as Radio group does not have a TabLabel property.
This is how the code looks like for Signature and Date fields (I'm using the c# sdk)
Tabs = new Tabs
{
SignHereTabs = new List<SignHere> {
new SignHere
{
//use the wildcard matching id the signer
TabLabel = $"_es_:signer{signer.SignerId}\\*"
}
},
DateSignedTabs = new List<DateSigned>
{
new DateSigned
{
TabLabel = $"_es_:signer{signer.SignerId}\\*"
}
},...
How do I add the radio group the same way ?
Thanks in advance
Try this:
RadioGroupTabs = new List<RadioGroup>
{
new RadioGroup
{
GroupName = $"_es_:signer{signer.SignerId}\\*"
}
},...

nlapiSendEmail not attaching to a custom record

I have a script emailing a custom PDF to an entity. The PDF is generated from a custom record, and I want to be able to see the email from the entity (ok - no problem), and also the custom record mail merge tab (or comms).
Entity is fine, but the custom record is not showing the email:
The code:
var records = new Object();
records['entity'] = venId[each];
records['customrecord_sow'] = sowId;
log('Attach email to records: '+stringify(records));
nlapiSendEmail(nlapiGetUser(), recipient, subject, body, null, null, records , newFile,true);
When I view the log, the record variable contains the following:
Attach email to records: { "entity": 11, "customrecord_sow": "264" }
The record internal id is correct, as the the custom record id. But the email does not show in the mail merge on the record.
What have I missed?
For custom records, you have to specify both the custom record type id as well as the custom record id in the records object. So in your case, you would need to do something like this:
records['recordtype'] = 'customrecord_sow';
records['record'] = sowId;
in place of records['customrecord_sow'] = sowId;

How to populate DocuSign Name field with something other than Sender name?

I'm using DocuSignAPI SDK to send envelopes. I have a few templates defined and they use a Custom Field called MemberFullName.
The field is of type Name, FullName.
For some templates I want MemberFullName map to a Signer's name, but sometimes I want to map another name to it.
My assumption was if I don't map anything to MemberFullName, then Signer's name will be used. But if I add "fullNameTabs" for MemberFullName, then it will be mapped.
Signer sgnr = new Signer()
{
RoleName = "Someone other than Member",
RecipientId = "1",
Name = "Bob Signer",
Email = "bobsemailaddress#yahoo.com"
};
sgnr.Tabs.FullNameTabs = new List<FullName>();
sgnr.Tabs.FullNameTabs.Add(new FullName() { TabLabel = "MemberFullName", Name = "Joe Smith" });
But MemberFullName is still mapped to Signer name in the resulting document.
How can I map a NON-SIGNER name to a field of type "Name"?
I know I can create a different field of type TEXT and map "Joe Smith" to it, but I wanted to reuse the "MemberFullName" field in both situations.
I apologize as I may not be using correct "docusign terminology" for things.
You will not be able to set the value of FullName tab manually. See this answer
for more information.

Resources