Search code examples
dynamicdocusignapi

Docusign: Dynamic Fields not replaced in the document


`{
    "emailSubject": "Test Mail",
    "templateId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "templateRoles": [
    {
      "email": "[email protected]",
      "name": "xxxxx",
      "roleName": "Signer",
      "tabs": {
        "textTabs": [
          {
            "tabLabel": "Name",
            "anchorString": "{{Name}}",
            "value": "John Doe"
          },
          {
            "tabLabel": "InterviewDate",
            "anchorString": "{{InterviewDate}}",
            "value": "2023-06-15"
          },
          {
            "tabLabel": "InterviewTime",
            "anchorString": "{{InterviewTime}}",
            "value": "10:00 AM"
          },
          {
            "tabLabel": "InterviewLocation",
            "anchorString": "{{InterviewLocation}}",
            "value": "123 Main St"
          }
        ]
      }
    }
  ],
  "status": "sent"
}`

Sample Doc File

I am using docusign to send candidate a mail. The send with the template document. But when make the api response the dynamic value's are not replaced, it's overlapped.

see attached image (output)


Solution

  • You are confusing two things here.

    If you are trying to use document generation, the {{fields}} like this should be in a Word document (.docx) and then added to a template. Then you make a different API call to update their values in the envelope generated from this template. See more details in the code example

    Now, another option is that you just want to have text tabs and set their value. That's different. In that case you don't use document generation, you don't use double curly brackets at all, you can use any document(s) you want and you make an entirely different API call to update tabs' values. If that's what you want to do - follow this code exmaple.