Search code examples
docusignapi

DocuSign - Add pre-fill tabs through JSON marker


I'm creating a html document and want to place tabs using JSON markers. This method works for common tabs of signers. However, I want to add pre-fill tabs for senders using the same approach but all pre-fill tabs are not showing up.

I'm using CompositeTemplate to generate the envelope. As pre-fill tabs don't belong to any recipients, so I put them under document level. The code snippet looks like

EnvelopeDefinition().apply {
  emailSubject = ...
  emailBlurb = ...
  this.status = "created"
  compositeTemplates = listOf(
    CompositeTemplate().apply {
      document = Document().apply {
        documentId = "1"
        name = "some document.pdf"
        htmlDefinition = "<div>{{\"tabLabel\": \"exampleTextTab\"}}</div>"
        tabs = Tabs().apply {
          prefillTabs = listOf(
            PreFillTab().apply {
              tabLabel = "exampleTextTab"
              font = "arial"
              fontSize = "size8"
              locked = "true"
            }
          )
        }

Solution

  • Pre-fill tabs don't currently work with Composite Templates. DocuSign internal ticket TT-5404

    Solutions

    Will your API program be setting the values of the pre-fill tabs? If so, then don't use pre-fill tabs. Instead:

    • use regular tabs with the first signer
    • set the locked attribute to true

    This makes the tabs read-only and they will be visible to all recipients. This will have the same effect as your API application adding and setting pre-fill tabs to the envelope.

    Pre-fill tabs are needed when the Sender needs to fill in the values and the Sender is not one of the recipients of the envelope.

    For an API program that uses the Sender View to enable the Sender to review the envelope and fill in pre-fill tabs, there are some options:

    • Your API application can ask the Sender for the pre-fill tab values. Your application can then set those values as regular (locked) tabs as described above.
    • Or you could add the pre-fill tabs to the template itself.
    • Or (I have not tried this), instead of adding the pre-fill tabs as part of the composite template object, make an additional API call to add the pre-fill tabs by using EnvelopeDocumentTabs:create