Nathan Youngman
Nathan Youngman

Reputation: 21

Is there a working example of pre-filling an existing DocuSign template with prefillTabs and titleTabs?

I've been struggling with the DocuSign documentation to get an existing template to auto-fill. The textTabs is working, but titleTabs aren't filling in the Title type field, and apparently prefillTabs can't be sent with the recipient, but it's not clear where to send it.

I happen to be using Elixir with the unofficial Elixir library https://github.com/neilberkman/docusign_elixir, but the data structures should be the same as any other language.

signer = %TemplateRole{
      email: to.email,
      name: to.name,
      roleName: "Client",
      tabs: %EnvelopeRecipientTabs{
        # set tab values in a template:
        # https://developers.docusign.com/docs/esign-rest-api/how-to/set-template-tab-values/
        titleTabs: [
          # TODO: Title tabs are not prefilling the Title type field
          %DocuSign.Model.Title{
            value: "My Title",
            tabLabel: "Title c1e5eba4-fcea-4ebd-a7fd-55339689b5c7"
          }
        ],
        textTabs: [
          %DocuSign.Model.Text{
            value: "My Text",
            tabLabel: "Text 78971077-4685-4e5f-b1d6-c8371a5d5168"
          }
        ],
        prefillTabs: %PrefillTabs{
          textTabs: [
            %DocuSign.Model.Text{
              value: Date.utc_today() |> to_string(),
              tabLabel: "Effective Date dc501978-6c07-425d-84ba-b1d5eba1814c"
            }
          ]
        }
      }
    }

I haven't been able to find a working example of doing this. https://developers.docusign.com/docs/esign-rest-api/how-to/set-template-tab-values/ doesn't include the title or prefill tabs.

https://www.docusign.com/blog/developers/common-api-tasks-customize-your-envelopes-pre-fill-fields doesn't utilize an existing template.

Upvotes: 2

Views: 302

Answers (1)

Inbar Gazit
Inbar Gazit

Reputation: 14050

You cannot set the value of a titleTab because it's meant to capture the title of the recipient.

The pre-fill tabs are for the sender, if you want recipient tabs, you can set their value just like you did with the text tab.

However, some tabs such as Date, Initial, SignHere, Title, and a few others cannot be set via the API.

You can also try this from the DocuSign web app, what's possible from there - is possible from the API.

Upvotes: -1

Related Questions