Skip to main content
Question

Composite template: Adding a recipient in a conditional recipient group


Forum|alt.badge.img+2

I have been successfully using a composite template to add recipients to a server template.(see attached code) However, one of the recipients - Approver at routing order 3 is now a part of a conditional recipient group. (See attached image)

 

When I now try to overwrite the recipient at routing order 3, i end up with two recipients at routing order 3 instead of one. (See attached image)

 

I tried a workaround where I would simply update the recipient at routing order 3 using PUT method of the recipients endpoint in the REST api, however that did not work either. 

 

How can I overwrite the recipient in the conditional routing group at routing order 3 using a composite template?

 

 

{
  "emailSubject": "@{variables('SubjectLine')"},
  "status": "sent",
  "compositeTemplates": [
    {
      "serverTemplates": [
        {
          "sequence": "1",
          "templateId": "@{items('For_each')?['hrsys_docusigntemplateid']"}
        }
      ],
      "inlineTemplates": [
        {
          "sequence": "2",
          "recipients": {
            "signers": [
              {
                "email": "@{items('For_each')?['hrsys_approveremail']"},
                "name": "@{items('For_each')?['hrsys_approvername']"},
                "recipientId": "2",
                "roleName": "Approver",
                "routingOrder":"3"
              },
              {
                "email": "@{items('For_each')?['hrsys_revieweremail']"},
                "name": "@{items('For_each')?['hrsys_reviewername']"},
                "recipientId": "1",
                "roleName": "Reviewer",
                "routingOrder":"1"
              }
            ]
          }
        }
      ],
      "document": {
        "documentBase64": "@{outputs('Get_Document')?['body/$content']"},
        "documentId": "1",
        "fileExtension": "pdf",
        "name": "New Document"
      }
    }
  ]
}

 

 

6 replies

Michael.Rave
Docusign Employee
Forum|alt.badge.img+14
  • Docusign Employee
  • 927 replies
  • January 24, 2025

@nitish555 

The syntax for normal “recipients” and “conditional recipients” is different and you need to send a different payload to change the recipient name and email address. This explains why it is adding a new recipient, as you provide the data in the different attribute.

This Docusign Support article has an example on how to configure the conditionalRecipients.

    "recipientRouting": 
      {
        "rules": 
        {
          "conditionalRecipients": 
          [
            {
            "recipientId": 2,
            "order": "0",
            "recipientGroup": 
              {
                "groupName": "Approver",
                "groupMessage": "Members of this group approve a workflow",
                "recipients": 
                [
                  {
                    "recipientLabel": "signer2a",
                    "name": "'"${SIGNER_NOT_CHECKED_NAME}"'",
                    "roleName": "Signer when not checked",
                    "email": "'"${SIGNER_NOT_CHECKED_EMAIL}"'"
                  },
                  {
                    "recipientLabel": "signer2b",
                    "name": "'"${SIGNER_WHEN_CHECKED_NAME}"'",
                    "roleName": "Signer when checked",
                    "email": "'"${SIGNER_WHEN_CHECKED_EMAIL}"'"
                  }
                ]
              },
              "conditions": 
              [
                {
                  "recipientLabel": "signer2a",
                  "order": 1,
                  "filters": 
                  [
                    {
                      "scope": "tabs",
                      "recipientId": "1",
                      "tabId": "ApprovalTab",                      
                      "operator": "equals",
                      "value": "false",
                      "tabType": "checkbox",
                      "tabLabel": "ApproveWhenChecked"
                    }
                  ]
                },
                {
                  "recipientLabel": "signer2b",
                  "order": 2,
                  "filters": 
                  [
                    {
                      "scope": "tabs",
                      "recipientId": "1",
                      "tabId": "ApprovalTab",
                      "operator": "equals",
                      "value": "true",
                      "tabType" : "checkbox",
                      "tabLabel": "ApproveWhenChecked"
                    }
                  ]
                }
              ]
            }
          ]
        }
      }
    }
    ]
  },

I suggest you download the template that is being used from Docusign eSignature as JSON to review the full template syntax and replicate the dynamic recipient section into your API call to create the envelope.

It is probably this section “recipients” under “recipientRouting” that you need to update:

                "recipients": 
                [
                  {
                    "recipientLabel": "signer2a",
                    "name": "'"${SIGNER_NOT_CHECKED_NAME}"'",
                    "roleName": "Signer when not checked",
                    "email": "'"${SIGNER_NOT_CHECKED_EMAIL}"'"
                  },
                  {
                    "recipientLabel": "signer2b",
                    "name": "'"${SIGNER_WHEN_CHECKED_NAME}"'",
                    "roleName": "Signer when checked",
                    "email": "'"${SIGNER_WHEN_CHECKED_EMAIL}"'"
                  }
                ]

 


Forum|alt.badge.img+2
  • Author
  • Newcomer
  • 5 replies
  • January 24, 2025

Hi Michael,

 

I tried your solution but I am probably not getting the composite template syntax right. I tried to insert the workflow object at several places in the composite template but none seems to be working.

I am attaching both the template JSON as well as the composite template JSON. 

Would you be able to review them and let me know what I am doing wrong?

 

Regards,

Nitish 

 


Michael.Rave
Docusign Employee
Forum|alt.badge.img+14
  • Docusign Employee
  • 927 replies
  • January 27, 2025

@nitish555 

Unfortunately, I am not able to review the provided examples and I cannot download ZIP attachments provided. Maybe someone else in the community is able and willing to review and support you with it.

This is not a valid topic for Docusign Support, as it would be Docusign Professional Services that assist customers with the implementation as a paid engagement.


Forum|alt.badge.img+2
  • Author
  • Newcomer
  • 5 replies
  • January 27, 2025

Thank you Michael. Will it be possible for you to provide a sample composite template code which uses a server template and also configures the conditional recipient from the server template?


Forum|alt.badge.img+8
  • Community Moderator
  • 319 replies
  • February 19, 2025

Hello ​@nitish555,

You may follow the steps provided in the link below on how to create a support case so we can provide further assistance.

Open a case in the Docusign Support Center

If you found the response to be a useful solution to your question, please mark it as the best answer by clicking “Select as Best” to make it easier for other users to find.

Best regards,
Marco Paulo | Docusign Community Moderator


Forum|alt.badge.img+8
  • Community Moderator
  • 319 replies
  • February 25, 2025

Hello ​@nitish555 ,

If you found the response to be a useful solution to your question, please mark it as the best answer by clicking “Select as Best” to make it easier for other users to find.

Best regards,
Marco Paulo | Docusign Community Moderator