# Select Salesforce objects and fields to synch

Your Salesforce Contact and Account objects likely receive thousands of record updates a day. You don't want every record update to trigger the data synch with SlapFive. Fortunately, Salesforce lets you use Outbound Messages and Flows to determine which fields to monitor for changes, and which fields to pass to SlapFive.

{% hint style="info" %}
**NOTE:** Before doing this step, you should have already worked with your SlapFive CSM to fill out your Salesforce <--> SlapFive data mapping matrix. You should also request the Endpoint URL needed for the Outbound Message from your SlapFive CSM.
{% endhint %}

These instructions show you how to do this for the Salesforce Account object. You can mirror these steps for Salesforce Contact and other objects.

## 1. Create a new Outbound Message

* [ ] Go to **Setup** > **Process Automation** > **Workflow Actions** > **Outbound Messages** and click the **New Outbound Message** button.&#x20;
* [ ] In the **Object** dropdown list, select **Account** and click **Next**.

<figure><img src="https://2901117923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlkxMKaLwhXP9Cu98jtv6%2Fuploads%2FGxAMMSrBpjTrtyHSf3bq%2FScreenshot%202024-11-18%20121139.png?alt=media&#x26;token=9c4fe9ab-5ced-45b5-8df0-5618cea6bdfc" alt=""><figcaption></figcaption></figure>

When creating the new Outbound Message:

* [ ] **Name:** type the name *Account Creates/Updates SlapFive Company* if setting this up for the Account object. Type the name *Contact Creates/Updates SlapFive Member* if setting this up for the Contact object.
* [ ] **Endpoint URL:** SlapFive will provide you with this URL.
* [ ] **User to send as:** select your integration user record that has read/write access to Accounts.
* [ ] **Account fields to send:** from the **Available Fields** box, select all Account fields that you want to either monitor for changes, synchronize with SlapFive, or both, and add them to the **Selected Fields** box. When in doubt, include the field.

Click the **Save** button.

## 2. Create a Flow

* [ ] Go to **Setup** > **Process Automation** > **Flows** and click the **New Flow** button.
* [ ] Select the **Record-Triggered Flow** box and click **Create**.

<figure><img src="https://2901117923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlkxMKaLwhXP9Cu98jtv6%2Fuploads%2FbSVi5HwD5acuQjAWostv%2FScreenshot%202024-11-18%20122415.png?alt=media&#x26;token=483ef4b3-3dec-454e-b144-7cf5b6d4b3c5" alt=""><figcaption><p>Configure the Flow</p></figcaption></figure>

When creating the new Flow:

* [ ] **Object:** Select **Account** from the dropdown list.
* [ ] **Trigger the Flow when:** \
  If you are synchronizing record changes on an ongoing basis, select **A record is created or updated**. \
  If you only want to send new Accounts to SlapFive, select **A record is created**.

Scroll down to the **Set Entry Conditions** section of the page.

<figure><img src="https://2901117923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlkxMKaLwhXP9Cu98jtv6%2Fuploads%2FjdlWZEi0y9U2vGXo2UnH%2FScreenshot%202024-11-18%20122610.png?alt=media&#x26;token=63316c13-4114-4c54-8a1d-c2e047d321b9" alt=""><figcaption><p>Set Entry Conditions</p></figcaption></figure>

In the **Set Entry Conditions** section:

* [ ] **Condition Requirements:** in most cases, you will select **Any Condition is Met (OR)**. This allows you to select all the fields that you want to monitor for changes, and apply OR logic so that if any one of them changes, the data synchronization will run.
* [ ] For fields that you want to update SlapFive any time the value of that field changes:
  * [ ] **Field:** select the field name.
  * [ ] **Operator:** select **Is Changed**.
  * [ ] **Value:** select **True**.
* [ ] If you only want the data synch to run when a field is set to a specific value:
  * [ ] **Field:** select the field name.
  * [ ] **Operator:** select **Equals**.
  * [ ] **Value:** type the value that will trigger the data synch. If this is a Yes/No field, select True or False respectively.

When done entering Entry Conditions, scroll down the page. To complete the setup, check the **Actions and Related Records** box and click **Done**.

## 3. Add the Outbound Message to the Flow

<figure><img src="https://2901117923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlkxMKaLwhXP9Cu98jtv6%2Fuploads%2FUNebT0QJjPqkvrms1pYn%2FAccount.png?alt=media&#x26;token=e13af201-6f2b-4281-80bf-bba44c08b456" alt=""><figcaption><p>Flow Builder</p></figcaption></figure>

You will now see the visual Flow Builder screen. Click the **+** button (Add Element) that is right above the red End icon. In the pop-up, and under the **Interaction** header, select **Action**.

<figure><img src="https://2901117923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlkxMKaLwhXP9Cu98jtv6%2Fuploads%2FJiV7napgnZUQkmBaGZug%2FAccount.png?alt=media&#x26;token=ec36ca9a-b86d-4311-a42b-59a45cbc349d" alt=""><figcaption><p>New Action window</p></figcaption></figure>

In the Category list on the left, click **Outbound Message,** then in the Action list, select the Outbound Message you created in the Create a new Outbound Message step, which will be *Account Creates/Updates SlapFive Company* or *Contact Creates/Updates SlapFive Member.*

<figure><img src="https://2901117923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlkxMKaLwhXP9Cu98jtv6%2Fuploads%2F9jSPRXosyrDSwyEYKpiU%2FAccount.png?alt=media&#x26;token=ddca520a-ecd5-443d-8ff1-82a239e1651e" alt=""><figcaption><p>New Action window</p></figcaption></figure>

In the **Label** field, type *Account Creates/Updates SlapFive Company* if this is for the Account object or *Contact Creates/Updates SlapFive Member* if this is for the Contact object, and then click **Done**.

<figure><img src="https://2901117923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlkxMKaLwhXP9Cu98jtv6%2Fuploads%2FBJOiduGgLJF0tnTUVGiu%2FAccount.png?alt=media&#x26;token=84580e8d-7eb9-4aa7-82a8-aae3d104b788" alt=""><figcaption><p>Flow Builder with Action added</p></figcaption></figure>

Click the Save button.

<figure><img src="https://2901117923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlkxMKaLwhXP9Cu98jtv6%2Fuploads%2FywNqFgGL3qe6RLA5yV4B%2FAccount.png?alt=media&#x26;token=b3ff7764-3f70-463d-97b9-c98ace65f4bf" alt=""><figcaption><p>Save the Flow</p></figcaption></figure>

In the **Flow Label** field, type *Account Creates/Updates SlapFive Company* if this is for the Account object or *Contact Creates/Updates SlapFive Member* if this is for the Contact object, and click **Save**.

<figure><img src="https://2901117923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlkxMKaLwhXP9Cu98jtv6%2Fuploads%2FhnBkPF3RxeamuZ6fszWY%2FAccount.png?alt=media&#x26;token=852d8224-09c2-4d60-9956-f5e75b878c78" alt=""><figcaption><p>Activate the Flow</p></figcaption></figure>

Click the **Activate** button.
