# Salesforce

Integrate Distro with Salesforce to optimize your meeting scheduling process and ensure your CRM data is consistently synchronized. This integration provides automatic lead creation, contact creation, updates, and efficient meeting management within Salesforce.

## Connect Distro with Salesforce

When connecting Salesforce, Distro requests the following permissions:

{% hint style="success" %}

* Read and write access to Leads
* Read and write access to Contacts
* Read and write access to Accounts
* Read and write access to Events
* Read access to user information
  {% endhint %}

{% stepper %}
{% step %}
Navigate to the Integrations page in your Distro dashboard

<figure><img src="/files/VVHbBnHJftOh1P0OQVoN" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Click on the Salesforce integration card
{% endstep %}

{% step %}
You'll be redirected to Salesforce's authorization page
{% endstep %}

{% step %}
Grant Distro permission to access your Salesforce account
{% endstep %}
{% endstepper %}

## What does Distro do to your Salesforce account

#### Lead/Contact Management <a href="#leadcontact-management" id="leadcontact-management"></a>

When enabled in your router settings, Distro can:

* Create new Leads or Contacts based on your configuration
* Search for existing Contacts by email
* Update Lead/Contact information when matches are found
* Modify Lead/Contact ownership based on meeting assignments

#### Meeting Management <a href="#meeting-management" id="meeting-management"></a>

Distro creates and manages activities in Salesforce by:

* Creating Event records when bookings are confirmed
* Updating Event statuses (Scheduled, Rescheduled, Completed, No Show, Cancelled)
* Linking Events to associated Leads/Contacts
* Setting Event properties:
  * Meeting title
  * Start and end times
  * Meeting location (Remote)
  * Meeting status
  * External meeting URL

## Custom Properties in Salesforce <a href="#custom-properties-in-salesforce" id="custom-properties-in-salesforce"></a>

Distro automatically creates custom fields in Salesforce to track meeting and prospect information. These fields are created for Lead, Contact, and Activity objects.

#### Important: Field Visibility Requirements <a href="#important-field-visibility-requirements" id="important-field-visibility-requirements"></a>

Before using these custom fields:

1. Navigate to Setup in Salesforce
2. Go to Object Manager
3. Select the respective object (Lead, Contact, or Activity)
4. Go to Field & Relationships
5. For each Distro custom field:
   * Click on the field name
   * Click on "Set Field-Level Security"
   * Ensure the field is visible for all necessary profiles
   * Click on "Page Layouts"
   * Add the field to the appropriate page layouts

Without proper field visibility settings, the integration may not function correctly.

#### Lead Custom Fields <a href="#lead-custom-fields" id="lead-custom-fields"></a>

* **Distro Meeting Type** (`Distro_Meeting_Type__c`)
  * Type: Text (100 characters)
  * Tracks the type of meeting scheduled
* **Distro Meeting Date** (`Distro_Meeting_Date__c`)
  * Type: DateTime
  * Records when the meeting is scheduled
* **Distro Meeting Status** (`Distro_Meeting_Status__c`)
  * Type: Picklist
  * Values:
    * Scheduled
    * Rescheduled
    * Completed
    * No Show
    * Cancelled
* **Distro No Show** (`Distro_No_Show__c`)
  * Type: Checkbox
  * Indicates if the prospect missed the meeting
* **Distro Router Name** (`Distro_Router_Name__c`)
  * Type: Text (75 characters)
  * Stores the name of the Distro router used
* **Distro Meeting Created At** (`Distro_Meeting_Created_At__c`)
  * Type: DateTime
  * Records when the meeting was initially created

#### Contact Custom Fields <a href="#contact-custom-fields" id="contact-custom-fields"></a>

The same fields are created for Contacts:

* `Distro_Meeting_Type__c`
* `Distro_Meeting_Date__c`
* `Distro_Meeting_Status__c`
* `Distro_No_Show__c`
* `Distro_Router_Name__c`
* `Distro_Meeting_Created_At__c`

#### Activity Custom Fields <a href="#activity-custom-fields" id="activity-custom-fields"></a>

Activity objects receive the following custom fields:

* `Distro_Meeting_Type__c` (Text, 75 characters)
* `Distro_No_Show__c` (Checkbox)
* `Distro_Canceled__c` (Checkbox)
* `Distro_Router_Name__c` (Text, 75 characters)

These custom fields are automatically created when you connect Salesforce to Distro, allowing you to track and report on meeting-related data within your Salesforce instance.

## What Happens When a Form is Submitted?

{% @mermaid/diagram content="graph TD A\[Form Submission] --> B{Check Router Settings} B --> C{Record Management} B --> D{Rule Evaluation}

```
C --> C1{Create Record?}
C1 -->|Yes| C2[Create Lead/Contact]
C1 -->|No| C3[Skip Creation]

C --> C4{Update Record?}
C4 -->|Yes| C5[Update Lead/Contact]
C4 -->|No| C6[Skip Update]

D --> D1{Meeting Owner in CRM?}
D1 -->|Yes| D2[Update Owner Field]
D1 -->|No| D3[Skip Owner Update]

D --> D4[Evaluate Rules]
D4 --> D5{Rule Match Found}

D5 -->|Yes| E[Meeting Creation]
D5 -->|No| F[Default Routing]

E --> G[Create Event Record]
G --> H[Update Lead/Contact Fields]

subgraph "Rule-Based Updates"
    D2 --> RU1[Wait 30s]
    RU1 --> RU2[Update Salesforce Owner]
    D4 --> RU3[Apply Field Updates]
    RU3 --> RU4[Update Custom Fields]
end

subgraph "Event Status Updates"
    G --> MS1{Status Changes}
    MS1 -->|Scheduled| MS2[Update Event]
    MS1 -->|Rescheduled| MS3[Update Event]
    MS1 -->|Completed| MS4[Update Event]
    MS1 -->|No Show| MS5[Update Event & Flag]
    MS1 -->|Cancelled| MS6[Update Event]
end

subgraph "Lead/Contact Decision"
    C2 --> LC1{Existing Contact?}
    LC1 -->|Yes| LC2[Use Contact]
    LC1 -->|No| LC3{Create as Lead?}
    LC3 -->|Yes| LC4[Create Lead]
    LC3 -->|No| LC5[Create Contact]
end
```

```"
```


---

# 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.distro.so/crm/salesforce.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.
