Search code examples
c#docusignapidocusign-sdk

DocuSign Variable Number of Signers


I am working on a DocuSign template that needs to support either 2 signers or 3 signers depending on the case and then send a CC to 4 different recipients.

Here is a screenshot of my template recipients: template recipients

If I create an envelope with two signers and skip routing order 3 (since I don't need a third signature in this case) and move to 4, 5, 6, 7 CC recipients my envelope looks like this on creation: envelope recipients

It successfully skips the signer in routing order 3. However, it is turning CC recipients 5 and 6 from "Receive a Copy" to "Needs to Sign". I have no idea why it is doing this - this is in direct violation of the template recipient types. I do not want to create two identical templates with the only difference being 2 signers or 3 signers. Does anyone have any idea why it is doing this or how I can fix this?

Is there a better way to have a variable number of signers on a template?

Thanks for any help on this.


Solution

  • Here is the documentation on Conditional Routing, which is the recommended solution for this use case.

    You could also use the API, but that'd be considerably more difficult.

    Troubleshooting

    Create your template with conditional routing. If you can't get it to do what you want, then DocuSign customer service is a good bet.

    Or you can download the template, unzip, and open it. Then use a JSON pretty printer to make it legible. Then look for the recipients and related routing rules to see if they look right to you.

    Trying to create conditional routing rules via the API is not a good idea. Create a template with the routing rules via the DocuSign web app.

    Using the API to affect the envelope routing

    The API can be used to change the envelope routing order.

    If the required routing order is known before the envelope is sent

    1. Create the envelope as a draft (status = created) (best: from a template)
    2. Add/remove recipients as needed using separate API calls
    3. Update the envelope to send it (status = sent)

    If the routing order is changed after a recipient enters data

    In this case, we want to pause the envelope after the recipient completes their work, check the tab value, and then (if appropriate) change the routing order

    1. When creating the template, add a fake recipient ("Check Data") after the real recipient who will be entering the data
    2. When creating the envelope, use composite template to change the fake recipient to become an embedded ("captive") recipient. This way, routing will pause when it is the fake recipient's turn to sign.
    3. Add a webhook to the envelope or to the account so that your app will be notified when the real recipient has completed signing.
    4. When your app is notified (via the webhook), get the value of the envelope's tab that the recipient set. Check it to see how the routing order should be changed.
    5. Lock the envelope, then modify the recipients as needed. At a minimum, delete the fake recipient (this will enable the envelope to proceed).
    6. Release the lock, the envelope should then continue processing.

    Clearly, it would be a lot better/smarter to used DocuSign's conditional routing feature!