---
title: "Send a contract based on conditions"
url: "https://docs.signnow.com/docs/salesforce-conditional-contract-sending"
type: "page"
section: "Integrations"
slug: "salesforce-conditional-contract-sending"
---

# Send a contract based on conditions

# Send a contract to one or two sellers based on conditions

The **SignNow integration for Salesforce** allows you to configure templates and automate document workflows directly from Salesforce records. This flexibility allows you to tailor your signing process to specific business needs, for example, sending a contract that requires either one or two sellers to sign.

**Use case overview**

**Actors**: 

- Buyer (contract sender)
- Sellers (contract recipients)

Your company purchases goods from retailers. The Salesforce Opportunity stores information about the sellers. A Salesforce user acts as the buyer, preparing and signing the sales contract and sending it to one or two sellers.

To achieve this, create two SignNow document flows in Salesforce:

- One configured for a single seller
- Another configured for two sellers

Each **flow** includes a **template** — a pre-configured document with fillable fields and defined recipients — and defines how the template is sent and what permissions the sender has when triggering it.

Next, add two **Send contract** buttons to the Salesforce object page and apply conditional visibility rules based on the **Seller 2 Email** field. When **Seller 2 Email** is populated, Salesforce displays the button linked to the two-seller template; when it’s empty, the button for the one-seller template appears.

Follow the steps below to configure this setup in Salesforce.

```mermaid
flowchart TB
    Start["Salesforce Opportunity"]
    Decision{"Is Seller 2 Email populated?"}
    Prepare1["Buyer triggers 'Send contract (1 seller)' flow"]
    Prepare2["Buyer triggers 'Send contract (2 sellers)' flow"]
    Sign1["Buyer signs and sends contract to 1st Seller"]
    Sign2["Buyer signs and sends contract to both Sellers"]
    Seller1["Seller 1 reviews and signs contract"]
    Seller2["Seller 2 reviews and signs contract"]
    Collect["Buyer collects all signed contracts in Opportunity"]

    Start --> Decision
    Decision -- "No" --> Prepare1
    Decision -- "Yes" --> Prepare2
    Prepare1 --> Sign1
    Prepare2 --> Sign2
    Sign1 --> Seller1
    Sign2 --> Seller1
    Sign2 --> Seller2
    Seller1 --> Collect
    Seller2 --> Collect
```

## Step 1. Create a one-seller document flow

### Create a contract template

Let's create a contract template for one seller.

- Go to **SignNow** **Admin Tools** > **Templates > Create New Template**.
- Upload the sales contract from your device.
- Click **Add Fillable Fields** to open the contract in the editor.
- Add recipients who need to sign the contract and manage their access level.

You can do this now or later when configuring the document flow.

We will add the **buyer** and **one seller.**

- Add fillable fields for the buyer:
    - Date and Time 1
    - Signature 1
    - Text Field 1
    - Date and Time 2
- Add fillable fields for the seller:
    - Signature 2
    - Text Field 2
    - Date and Time 3

![editor_1seller.png](/reference-assets/images/SignNow_Salesforce/use_case_2/editor_1seller.png)

- Click **Done** to save the changes.

### Pre-fill fillable fields

On the **Templates** tab, click **Pre-fill Fillable Fields** to set up field mapping.

> You can pre-fill fields only from the Salesforce object where the document sending is initiated and its parent object. For example, when sending a document from an Opportunity, you can also pre-fill data from the Account. To include data from related objects, create hidden fields on the main object and use formula fields to pull those related values in.

- Set up mapping to pre-fill contract fields with Opportunity records data.

Let's pre-fill the contract date, buyer name, and buyer signing date.

> Use the **Field Editing** column to define whether recipients can edit the pre-filled data (**Allow Editing** is enabled by default).


> You can configure data mapping to either pre-fill the document only or both pre-fill the document and update the connected Salesforce record. When updating a record in Salesforce, ensure that the document field and the Salesforce field are compatible and comply with validation rules. For example, map a date field in Salesforce to a date field in the document. Attempting to update a date field with text will cause the update to fail.

Click the arrow in the second column to adjust the mapping behavior. By default, mapping only pre-fills the document.


Learn more about [pre-filling fields](/docs/templates#pre-fill-fillable-fields).

![prefill_1seller.png](/reference-assets/images/SignNow_Salesforce/use_case_2/prefill_1seller.png)

- Click **Save**.

### Create a document flow

Select the **Document Flows** tab > **Create Document Flow** to configure the one-seller flow.

- Name the flow and select which steps the [sender can configure](/docs/document-flows#configure-the-senders-experience).

**Tip**: When naming a document flow, start with the Salesforce object that triggers the flow, followed by the template name. This approach helps you quickly identify which flow is linked to a custom button on the Salesforce object and update it when needed.

For example: `Opportunity - Sales contract (1 seller)`

![flow_create_1seller.png](/reference-assets/images/SignNow_Salesforce/use_case_2/flow_create_1seller.png)

- Customize email invite message.
- Add the seller and buyer email addresses.

> The steps you add in the document flow must **exactly match** the steps defined in the template, including the same names. This ensures that the flow triggers correctly and that all recipients and permissions align with the template configuration.

In this use case, we will send the contract to the sender (buyer) and the related Opportunity contact (seller).

[Generate tags](/docs/document-flows#pre-fill-recipient-emails-using-tags) to pre-fill the email fields.

![flow_recipients_1seller.png](/reference-assets/images/SignNow_Salesforce/use_case_2/flow_recipients_1seller.png)

- Click **Save** to save the flow configuration.

## Step 2. Configure the one-seller contract button

Now, let's create a button for sending a single-seller contract and add it to the Opportunity (or any object you need).

- Select **Custom Links.**
- Select the one-seller contract template you have configured.
- Add the one-seller document flow
- Enter the Salesforce object name where you want to add the button.

![custom_button_1seller.png](/reference-assets/images/SignNow_Salesforce/use_case_2/custom_button_1seller.png)

- Copy the link and add it to the object page layout as described [here](/docs/custom-links#add-the-custom-button-to-the-salesforce-object).

## Step 3. Create a two-seller document flow

### Create a contract template

Let's create a contract template for two sellers.

- Go to **SignNow** **Admin Tools** > **Templates > Create New Template**.
- Upload the sales contract from your device.
- Click **Add Fillable Fields** to open the contract in the editor.
- Add recipients that need to sign the contract and manage their access level.

You can do this now or later when configuring the document flow.

- Add fillable fields for the buyer:
    - Date and Time 1
    - Signature 1
    - Text Field 1
    - Date and Time 2
- Add fillable fields for seller 1:
    - Date and Time 3
    - Signature 2
    - Text Field 2
- Add fillable fields for seller 2:
    - Signature 3
    - Text Field 3
    - Date and Time 4

![editor_2sellers.png](/reference-assets/images/SignNow_Salesforce/use_case_2/editor_2sellers.png)

- Click **Done** to save the changes.

### Pre-fill fillable fields

On the **Templates** tab, click **Pre-fill Fillable Fields** to set up field mapping.

- Set up mapping to pre-fill contract fields with Opportunity records data.

Let's pre-fill the contract date, buyer’s name, and buyer's signing date. Lock the fields for editing by recipients.

Learn more about [pre-filling fields](/docs/templates#pre-fill-fillable-fields).

![prefill_2sellers.png](/reference-assets/images/SignNow_Salesforce/use_case_2/prefill_2sellers.png)

- Click **Save** to save the field mapping.

### Create a document flow

Select the **Document Flows** tab > **Create Document Flow** to configure the two-seller flow.

- Name the flow and select which [steps the sender can configure](/docs/document-flows#configure-the-senders-experience).

![flow_create_2sellers.png](/reference-assets/images/SignNow_Salesforce/use_case_2/flow_create_2sellers.png)

- Customize email invite message.
- Add the seller's and buyer's email addresses.

In this use case, we will send the contract to the sender (buyer), seller 1, and seller 2.

Generate tags to pre-fill the email fields.

![flow_recipients_2sellers.png](/reference-assets/images/SignNow_Salesforce/use_case_2/flow_recipients_2sellers.png)

- Click **Save** to save the flow configuration.

## Step 4. Configure the two-seller contract button

Create the button for sending the contract to two sellers. 

- Select **Custom Links.**
- Select the two-seller contract template you have configured.
- Add the two-seller document flow
- Enter the Salesforce object name where you want to add the button.

![custom_button_2sellers.png](/reference-assets/images/SignNow_Salesforce/use_case_2/custom_button_2sellers.png)

- Copy the link and add it to the object page layout as described [here](/docs/custom-links#add-the-custom-button-to-the-salesforce-object).

## Step 5. Set buttons visibility

Set visibility rules for the buttons you have created: **Send contract (1 seller)** and **Send contract (2 sellers)**, so that users see only the relevant option.

The **Send contract (1 seller)** should appear if the **Seller 2 Email** field is blank.

The **Send contract (2 sellers)** should appear if the **Seller 2 Email** field is not blank.

- Open a record (for example, Opportunity) > click the gear icon > **Edit Page**.

![button_visibility_edit_page.png](/reference-assets/images/SignNow_Salesforce/use_case_2/button_visibility_edit_page.png)

- In the Lightning App Builder, select the **Highlights Panel** (or the Actions section) and click **Add Action**.
- Add the buttons you have created to the actions list.

![button_visibility_add_actions.png](/reference-assets/images/SignNow_Salesforce/use_case_2/button_visibility_add_actions.png)

- Select the **Send сontract (1 seller)** action and add a visibility filter:
    - Visible when **Seller 2 Email** is blank

![button_visibility_seller_1.png](/reference-assets/images/SignNow_Salesforce/use_case_2/button_visibility_seller_1.png)

- Select the **Send сontract (2 sellers)** action and add a visibility filter:
    - Visible when **Seller 2 Email** is not blank

![button_visibility_seller_2.png](/reference-assets/images/SignNow_Salesforce/use_case_2/button_visibility_seller_2.png)

> If you don’t see **Actions**, add the Highlights Panel component and **Upgrade to Dynamic Actions**.

- **Save** and **Activate** the Lightning page.

## Step 6. Explore the user experience

Each time the **Seller 2** **Email** field is filled, Salesforce displays the **Send contract (2 sellers)** button on the Opportunity record.

When clicked, the user sends the preconfigured contract to two sellers and the buyer.

![flow_1seller.gif](/reference-assets/images/SignNow_Salesforce/use_case_2/flow_1seller.gif)

If the **Seller 2 Email** field is empty, Salesforce displays the **Send contract (1 seller)**

button. When clicked, the user sends the preconfigured contract to one seller and the buyer.

![flow_2sellers.gif](/reference-assets/images/SignNow_Salesforce/use_case_2/flow_2sellers.gif)



---
*Full page: https://docs.signnow.com/docs/salesforce-conditional-contract-sending*
