> For the complete documentation index, see [llms.txt](https://help.sdocs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sdocs.com/s-sign/template-configuration-fields-profiles-settings/handling-dynamic-signers-in-s-sign-enabled-templates.md).

# Handling Dynamic Signers in S-Sign Enabled Templates

This guide explains how to configure S-Sign templates to handle a variable number of signers by leveraging automation to generate profiles and signature fields based on record data.

***

### 1. Using Conditional Logic

The S-Docs Render Feature allows you to show or hide signer profiles and input fields based on specific conditions in your Salesforce data.

* How it works: Wrap your signer tags in \`\` statements. Entire Statement must be wrapped in double square brackets: `[[EXAMPLE]]`
* Example Use Case: Require a "Secondary Signer" only if the Opportunity Stage is 'Closed'.
* Key Syntax Example:

  ```
  <!--RENDER='{{!Opportunity.StageName}}' == 'Closed' -->
  [[SSIGN_PROFILE Email='signer2@example.com' ProfileName='Signer 2' RoutingPosition='2']]
  [[SSIGN_INPUT Profile='Signer 2' Type='Signature']]
  <!--ENDRENDER-->
  ```

#### Available Signer Profile Attributes

* ProfileName
* Email
* RoutingPosition
* DenyAudit
* DenyConfirmation
* SignerName
* PrevSignerProvidesThisSignersEmail
* denyConfirmationEmail (None, Partial, Complete, or Both)

#### Avaiable Input Field Attributes

* Type
* Profile
* Required (Type='Text', Type='Checkbox', and Type='Date' only)
* WriteTo (Type='Text' and Type='Date' only)
* TextDefault (Type='Text' only)
* Disabled (Type='Date' only)
* DateFormat (Type='Date' only)

***

### 2. Using Related Lists (LineItemsSOQL)

This method is best for scenarios where you need a signature from *every* person in a related list (e.g., all Contact Roles on an Opportunity).

* How it works: Use `LineItemsSOQL` to query a list of people and loop through them to generate unique signer profiles.
* Scaling: It automatically handles 1, 5, or 50 signers without manual updates.

#### Implementation Strategy

To use this, you typically create two SOQL statements:

1. Profile Generator: Creates the invisible `[[SSIGN_PROFILE]]` tags for each person.
2. Input Generator: Creates the visible `[[SSIGN_INPUT]]` (signature boxes) in the document body.

Example Configuration (Conceptual):

```
<!--{{!
<lineitemsSOQL>
<class>none</class>
<listname>opportunitycontactrole</listname>
<column prefix="[[SSIGN_PROFILE Email='" postfix="' ">Contact.email</column>
<column prefix="RoutingPosition='1" postfix="' ">rownum</column>
<column prefix="ProfileName='Signer C" postfix="']]">rownum</column>
<where>Opportunity.Id='{{!Opportunity.Id}}'</where>
</lineitemsSOQL>
}}-->
<!--{{!
<lineitemsSOQL>
<class>table239</class>
<listname>opportunitycontactrole</listname>
<column>Contact.Name</column>
<column prefix="<br /><div style='width:20pt;'>[[SSIGN_INPUT Type='Signature' Profile='Signer C" postfix="']]</div>">rownum</column>
<where>Opportunity.Id='{{!Opportunity.Id}}'</where>
</lineitemsSOQL>
}}-->
<!--{{!
<lineitemsSOQL>
<class>none</class>
<listname>accountcontactrole</listname>
<column prefix="[[SSIGN_PROFILE Email='" postfix="' ">Contact.email</column>
<column prefix="RoutingPosition='2" postfix="' ">rownum</column>
<column prefix="ProfileName='Signer A" postfix="']]">rownum</column>
<where>Opportunity.Id='{{!Opportunity.Id}}'</where>
</lineitemsSOQL>
}}-->
<!--{{!
<lineitemsSOQL>
<class>table239</class>
<listname>accountcontactrole</listname>
<column>Contact.Name</column>
<column prefix="<br /><div style='width:20pt;'>[[SSIGN_INPUT Type='Signature' Profile='Signer A" postfix="']]</div>">rownum</column>
<where>Opportunity.Id='{{!Opportunity.Id}}'</where>
</lineitemsSOQL>
}}-->
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.sdocs.com/s-sign/template-configuration-fields-profiles-settings/handling-dynamic-signers-in-s-sign-enabled-templates.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
