# Handling Dynamic Signers in S-Sign Enabled Templates

***

### 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: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
