I'm having trouble with uniquely identifying the documents I get back from a signed envelope that was created using composite templates with server templates.
I'm creating my envelope with one document per composite. The document is specified by a server template. This server template has tabs that will be filled in by an inline template.
My initial thought was to uniquely identify the documents I get back by the document name. However, I now have a case where the same envelope will have two copies of the same server template but with different values filled in for the tabs. These documents will have the same name when returned by the envelopes::listDocuments endpoint so this no longer works as a unique identifier. I looked into setting EnvelopeDocumentFields but can't figure out how to add those to a document when creating an envelope with the composite template model. How can I add a unique identifier to each document that's created from a server template? I'm using the docusign-esign node.js sdk
EDIT: I tried documentFields and wasn't able to get them to work by adding them to the document field of the inlineTemplate or the document field of the composite template. I was able to use customFields, building them document by document and assigning them a documentId that I give the same as the compositeTemplateId, assuming that the documentId assigned will be 1,2,3... I added them all to the inlineTemplate of the last compositeTemplate and then when I retrieve the envelope I get the custom fields and then kinda just rely on the fact that the documentId is set as 1,2,3... and that the custom field with that id will give me the document info I want. I don't really like this - it seems hacky.