Using the Api Explorer updating a template with a whole new set of tabs just appends the new tabs on top of the old ones.
The only way we can find to delete old tabs is this endpoint (with a broken documentation link) which assumes that I would like to carefully send a bespoke delete for each recipient and attach each tabId that isn't relevant. This is incorrect. I have new tabs that are correct, and old tabs that I don't care about.
Workarounds that I'd try, but are also not possible*:
delete the template and create a new one (there is no delete template endpoint)
delete all tabs in a template before updating the template (I cannot find any bulk delete actions for tabs)
list all tabs, and then for-each them into a delete (the list tabs endpoint is giving us a 404)
move the template to an archive/trash folder and create a new one in it's place. (it is not possible to move a template's folder location using Template Update)
update our representation of a tab with the tabId in the response, using X,Y,Page coordinates (coordinates are rounded/quantized, and you'd have to do fuzzy math for every tab to find the closest one, and that's super gross)
How are you supposed to replace all the tabs in a template?
*so far as I can tell
Solution to workaround 1:
The move envelopes endpoint also moves templates.
Make sure your folderId is "recyclebin"
{
"envelopeIds": [
"689c311a-118e-447d-a77d-3ea856510a75"
]
}
Related tip for workaround 4: (undocumented) a PUT to https://{baseUrl}/api/accounts/{accountId}/folders/templates
can move a template's folder
{
"foldersTemplates": [
{
"templateId": "eae13fee-dc17-40f5-aa09-f4d1705c31b6",
"folderId": "fb803413-bf4a-4706-9621-03f6915b3305",
"newFolderId": "a954b249-04ce-4fde-b564-1afa87c8beab"
}
]
}
Related
How you can create nested tabs in the backend? My task: create two new tabs within one tab. Let's say there are three tabs "Abc", "Def", and "Hig" with different fields inside. So, I need to create two new tabs (like the second level) inside the "Def" tab. How to do it? I didn't find a solution in the documentation.
The cleanest approach would be to use the nestedForm widget. Check out the documentation here: https://octobercms.com/docs/backend/forms#widget-nestedform
I'm trying to populate the textTabs in one of the documents so that it has information prefilled into it using the call for EnvelopeTabs: update, however it keeps throwing me an error that it cannot find the tab that I am trying to test in the explorer. I have used the list call in the EnvelopeTabs to make sure that the information that I'm providing matches what is in the envelope and it is, here's an example of what I was seeing
enter image description here
enter image description here
When I make the call to update the tab in textTabs, I am doing it with the documentId, pageNumber, and tabLabel provided above and with the value set to what I want to be prefilled, however I keep getting an error that it cannot find the specified tab.
I have even tried filling it in with just the tabId and am still getting the same error.
In an effort to see if I was missing something, I also tried checking the linked reference documentation on the EnvelopeTabs: update page but it is 404ing (as were one or two other end points in the api explorer).
Any help would be appreciated as it seems like there is a piece of information that I'm missing to prefill tabs.
Are you creating the envelope via the API? If so, then the easy way to set a tab's value is to set the value parameter.
If you want to set a tab's value after the envelope is created, use the EnvelopeRecipientTabs: update method. (Note the resource name in your question was incorrect.)
When using this method, or any other DocuSign update method, remember that it is not a patch method: You must supply all of the parameters for the Envelope Recipient Tab that you're updating. If you don't already have all of the settings, then first do a get on the object, then update it.
I tried using below JSON call to update the Recipient tab and its updating the tab value:
PUT /restapi/v2/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/tabs
{
"textTabs": [
{
"value":"newVal",
"tabId": "cef562dd-e098-4dcd-935d-34ff8f5b5211"
}
]
}
I'm trying to achieve a project documentation solution on SharePoint 2013 using a custom Document Set Content Type. Each new project Document Set would hold four types of documents.
My initial thought was to use folders for each type to allow easy drag and drop behavior for adding documents. The problem is, by default, folders can be created only by adding default documents to a Document Set Content Type. I wish to create the folders upon the creation of new instance of this Document Set but not add any documents inside these folders.
This is what I have tried so far:
Using workflow to delete default documents inside folders that were created in the new Document Set.
Custom folder Content Types.
The reason for use of folders is to avoid metadata tagging when uploading documents.
I'm quite restricted with the tools that I can use so the most basic level solutions would be appreciated.
To be more clear, I would hope to have a Document Set Content Type which holds four folders. Document Set would act as a holder for all documentation relevant for a single project and folders inside would group the documentation into groups. Each new project will generate documents in its lifespan and these documents should be grouped into categories, say marketing, finance, production and HR. So when I have a new project, I can create a new instance of custom Document Set with pre created, named, empty folders inside.
There's two ways you can achieve this I think. First would be to set-up your document set to have an empty document deployed to all of the folders you'd like to create. Simply add "Default Content" to your document set and there specify the correct folders. Unfortunately there's no way to create empty folders, so you'll need to put a dummy document in each folder which the user can then delete or override.
Second would require some coding. By attaching a remote event receiver to the library, you could trigger some custom code which would create the folder structure inside of the document set once created. This would allow you to create the folder structure without the need for dummy documents; so it's a bit more work which requires a developer, but the end result is also better.
The second solution you might also be able to pull off in a workflow (or Microsoft Flow) which then uses the API's to create the folders, but that's most likely less clean and more hassle to get working.
Create a custom content type called "Folder Creator". Use that content type to create the subfolders. Then have the "Folder Creator" content type auto delete using SharePoint Information Management Policies. Be sure to set your "Expiration Policy" job to run at least once a day.
We have defined a template that will be filled in and signed by our customers. In this template we have some fields that we pre-populate along with some documents that we will attach. The customer will fill in other fields and attach more documents. We are using the REST API to generate the sign request. We are able to generate the correct REST request to fill the tabs in the template, set the recipients and successfully send the signature request. All this works great. But now we're trying to get a document attached to the appropriate SignerAttachmentTab in the template and we cannot get REST to accept it.
We've tried using the Documents field but that doesn't work with templates it seems. We created a composite template and then defined a document for the document, server template for the template itself and an inline template to contain the tab data we want to populate. This keeps generating errors about the tab page number not being right. We've tried different values and we've looked over all the forum posts and documentation related to attaching documents to templates and none of them seem to work.
For the document we specify the file to upload, set the document ID and name. In the server template we specify the template ID. In the inline template we create a recipient, set their information, build up the envelope tabs with the data and then add a SignerAttachmentTab for the document. In this tab we set the document ID to match the document ID from the Document element. We set the tabLabel to the label used in the template itself. We've tried setting pagenumber but that doesn't change anything. All we want is for the document to be sent to the customer. When the open it they can double click the attachment field and view the document we're trying to send.
I'm trying to use the recipe explorer to get this to work using raw REST and it keeps failing with the TAB_PAGENUMBER_IS_NOT_IN_DOCUMENT error. It seems like the document is taking precedence over the template. Unfortunately I cannot change the order of the templates in the editor other than setting the sequence # on the server and inline templates. Here's the request that is generated using DocuSign's test system.
{
"compositeTemplates":[{
"document": {
"documentBase64":"<Base64BytesHere>",
"documentId":"2",
"name":"Test.pdf"
},
"inlineTemplates":[{
"recipients":{
"signers":[{
"email":"abc#def.org",
"name":"Person",
"recipientId":"1",
"roleName":"Sender 1",
"tabs":{
"signerAttachmentTabs":[{
"documentId":"2",
"tabLabel":"MyAttachment"
}],
"textTabs":[{
"tabLabel":"someText",
"value":"Value1" }
]}
}]},
"sequence":"2"
}],
"serverTemplates":[{
"sequence":"1",
"templateId":"guid}]
}],
"emailBlurb":"A message",
"emailSubject":"Test",
"status":"sent"
}
I've looked at the existing posts in the forums and either they don't work for my case or they aren't trying to actually attach the documents to the template but simply include them as a document in addition to the template.
Update
Re:
...associate [a] document to the tab so that the signer will be able to click the attachment field in the document and see the document
Yes, you can now do this by using Smart Sections with a documentHtmlDisplaySettings object in the Envelopes:create request. The collapsed (or collapsible) section can be displayed in different ways:
inline
collapsible
collapsed
continue_button
responsive_table
responsive_table_single_column
print_only
Live examples that you can try online
HTML source document
Word source document
Original answer
Re:
But now we're trying to get a document attached to the appropriate SignerAttachmentTab in the template and we cannot get REST to accept it.
You're trying to use the API to add a document to a SignerAttachmentTab?
This is not supported. Only signers themselves add documents to a SignerAttachmentTab. The API can't do it for them.
Is the issue that you want to make sure that a signer attaches (uploads) a document to the envelope as part of the signing ceremony? You can make the tab non-optional (required). But that won't check the contents of the attached file.
You could use a web hook / Connect to check the file(s) that were attached and, if the right files weren't attached, generate another enveloper for the signer.
I figured out what I was doing wrong. For a template without attachments I was using TemplateRole and EnvelopeTabs. But for attachments, trying to include any document would cause the document to override the template. So I switched to composite template with server and inline templates for the template and data. Trying to add documents in various combinations in the various areas where they are allowed generally caused the request to be sent but with no documents.
The final solution was to go back to the original TemplateRole approach but to create the envelope as a draft. After the draft envelope was created I could then add the document to the envelope. But unfortunately to send the envelope you then have to reattach the recipients. I'm looking to clean that up but otherwise it is working for me now.
I have a content type that has required fields. I have associated Word document with the content type as a template. I now want to edit the Word template, but word won't allow me to save the template without filling in the required fields. However, if I fill in the required fields and save the document, then those fields get populated with my values when you create a new document. This isn't good because I want the fields to be blank when a new document is created - I want the users to be forced to fill in those values.
I can update the templace by updating the colums and making them optional, editing the word template, saving the template & then changing the columns back to required. This is a PITA - there's got to be a better way, does anyone know what it is?
I've been using this work around: When I edit the template (ie go to the content type settings --> Advanced settings --> Edit Template), I make my changes and save the file locally. Then, on the same page that I clicked the "Edit Template" link, I upload the copy that I saved locally. Saving it locally avoids the validation that happens when you try to save it back to SharePoint. But the validation still gets applied to any new documents of that content type. So no need to toggle the settings off & on! :)
Have you tried saving the document as a normal document content type, making the changes, saving it, then moving back over the top of where the old version of the template was?
The only solution I've found is to modify document templates on library level. Just upload a new document template for the required content type.
However, this will not work if you'd like to re-use one and same content type across different document libraries.