> ## Documentation Index
> Fetch the complete documentation index at: https://moengage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync data from MoEngage to Salesforce

> Forward MoEngage campaign interaction events to Salesforce as Activities or any standard or custom Salesforce object using MoEngage Streams.

## Integration

<Info>
  **Prerequisites**

  * Follow the steps in [Set up MoEngage app on Salesforce](/partner-guide/data-and-analytics/crm/salesforce-crm-native/setup-moengage-app-on-salesforce) to set up the MoEngage Streams Connected App on Salesforce.
  * This is part of the Streams add-on. Contact your dedicated MoEngage Customer Success Manager (CSM) to get it enabled for your account.
</Info>

## Scope

| Context                                                                                           | Support status |
| ------------------------------------------------------------------------------------------------- | -------------- |
| Sync MoEngage campaign interaction events to Salesforce as Activities                             | Supported      |
| Sync MoEngage campaign interaction events to Salesforce as a standard or custom Salesforce object | Supported      |
| Support for all standard Salesforce field types (string, datetime, numeric, formula)              | Supported      |

## Steps

### Step 1: Set up streams on MoEngage

<Steps>
  <Step title="Open the MoEngage App Marketplace">
    Navigate to **MoEngage App Marketplace** > **Salesforce CRM**.
  </Step>

  <Step title="Click Integrate">
    Click **Integrate**.

    <Frame>
      <img src="https://mintcdn.com/moengage/cJSG0nHne5L3-Q_X/images/partner_31258016008340.png?fit=max&auto=format&n=cJSG0nHne5L3-Q_X&q=85&s=627fdbe8e712422d89d058a8bbd4904d" alt="MoEngage App Marketplace listing for Salesforce CRM with the Integrate button" width="1554" height="748" data-path="images/partner_31258016008340.png" />
    </Frame>
  </Step>

  <Step title="Add Salesforce account details">
    Enter your Salesforce account details (Secret ID, Secret Key).
  </Step>

  <Step title="Choose user attributes and events">
    Add the user attributes and events that you want to send to Salesforce.
  </Step>

  <Step title="Connect">
    Click **Connect**.
  </Step>
</Steps>

<Info>
  **No Integrate tab on the App Marketplace?**

  If you don't see the **Integrate** option on your dashboard, Streams is not enabled for your workspace. Contact the MoEngage Support team or your dedicated Customer Success Manager to get it enabled, providing the following details:

  * Salesforce domain
  * Salesforce Secret ID
  * Salesforce Secret Key
  * User attributes to be synced
  * Events to be sent to Salesforce
</Info>

### Step 2: Set up the sync on the MoEngage app in Salesforce

The sync consists of the following steps:

1. **Connections**: A Connection is the authorization to your MoEngage workspace. You can connect multiple MoEngage workspaces to a single Salesforce instance.
2. **Syncs**: A Sync is a job that runs in real time to send specific data between the two systems. It includes the sync type (MoEngage to Salesforce or Salesforce to MoEngage), entities to sync, and data mapping.

Other minor sections include **Error logs** and **Exceptions** — useful for debugging when the data sync is not working.

#### Launch the MoEngage app

Click **App Launcher**, enter *MoEngage*, and select **MoEngage App**.

<Frame>
  <img src="https://mintcdn.com/moengage/cJSG0nHne5L3-Q_X/images/partner_31258032459284.png?fit=max&auto=format&n=cJSG0nHne5L3-Q_X&q=85&s=b9e7afcb7fd49f3c165fe215037ffacb" alt="Salesforce App Launcher with the MoEngage App selected" width="684" height="634" data-path="images/partner_31258032459284.png" />
</Frame>

#### Set up a connection

<Steps>
  <Step title="Add a new connection">
    Click **Connections** > **Add New Connection**.

    <Frame>
      <img src="https://mintcdn.com/moengage/cJSG0nHne5L3-Q_X/images/partner_31258016016532.png?fit=max&auto=format&n=cJSG0nHne5L3-Q_X&q=85&s=8bdbfcd3f790b810ae730dc70be1edf9" alt="MoEngage Connections tab with the Add New Connection button" width="1594" height="294" data-path="images/partner_31258016016532.png" />
    </Frame>
  </Step>

  <Step title="Enter your MoEngage workspace details">
    Provide the following details:

    <Frame>
      <img src="https://mintcdn.com/moengage/cJSG0nHne5L3-Q_X/images/partner_31258016018196.png?fit=max&auto=format&n=cJSG0nHne5L3-Q_X&q=85&s=27f603ed2fc25f485e20c704ccf9492c" alt="MoEngage Connection form with workspace credentials" width="1298" height="764" data-path="images/partner_31258016018196.png" />
    </Frame>

    | Field name           | Value                                                                                                                        |
    | -------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
    | Connection Name      | Any name for your connection (for example, *MoEngage Prod* or *MoEngage Workspace*).                                         |
    | Workspace ID         | The Workspace ID of your MoEngage account, available at **Settings** > **Account** > **APIs** > **Workspace ID**.            |
    | Data Key             | The Data API Key of your MoEngage account, available at **Settings** > **Account** > **APIs** > **Data Key**.                |
    | MoEngage Data Center | Your MoEngage data center. [Read more](https://www.moengage.com/docs/user-guide/data/key-concepts/data-centers-in-moengage). |
  </Step>

  <Step title="Save the connection">
    Click **Save**.
  </Step>
</Steps>

#### Set up a sync

For this guide, we use the example of syncing MoEngage campaign interaction events to Salesforce as Activities. You can follow a similar process for other Salesforce objects.

##### Sync MoEngage campaign interaction events to Salesforce as Activities

<Steps>
  <Step title="Open Map Fields">
    Click **Map Fields**.

    <Frame>
      <img src="https://mintcdn.com/moengage/cJSG0nHne5L3-Q_X/images/partner_31258016019860.png?fit=max&auto=format&n=cJSG0nHne5L3-Q_X&q=85&s=51aeffe8457d1b8bbbc9cd6e2174061a" alt="MoEngage Connections list with the Map Fields action highlighted" width="2842" height="500" data-path="images/partner_31258016019860.png" />
    </Frame>
  </Step>

  <Step title="Add a new sync">
    Click **Add new sync**.

    <Frame>
      <img src="https://mintcdn.com/moengage/cJSG0nHne5L3-Q_X/images/partner_31258032476436.png?fit=max&auto=format&n=cJSG0nHne5L3-Q_X&q=85&s=8393139020ba9747410977f9caa39cf9" alt="MoEngage app Syncs tab with the Add new sync button" width="2808" height="170" data-path="images/partner_31258032476436.png" />
    </Frame>
  </Step>

  <Step title="Enter basic sync details">
    Provide the sync name, source event, and target object.

    <Frame>
      <img src="https://mintcdn.com/moengage/cJSG0nHne5L3-Q_X/images/partner_31258032478484.png?fit=max&auto=format&n=cJSG0nHne5L3-Q_X&q=85&s=9af0efb43d65b2904f9ba6c90c02a972" alt="Basic sync details form for a new MoEngage-to-Salesforce sync" width="2080" height="928" data-path="images/partner_31258032478484.png" />
    </Frame>
  </Step>

  <Step title="Continue">
    Click **Next**.
  </Step>

  <Step title="Configure data mapping">
    Configure the data mapping between the two systems:

    1. Define the identifier between the two systems. For MoEngage, the identifier name is **Customer ID** — it can be mapped to any field on the Activity object.

    2. Set up mappings for other fields. Enter the MoEngage attribute (these are passed in MoEngage Streams data) and select the Salesforce field that the MoEngage attribute should be mapped to.

           <Frame>
             <img src="https://mintcdn.com/moengage/cJSG0nHne5L3-Q_X/images/partner_31258016027156.png?fit=max&auto=format&n=cJSG0nHne5L3-Q_X&q=85&s=4de4784e4a3aef27685ef960b85a58a8" alt="Field mapping table with MoEngage attributes mapped to Salesforce Activity fields" width="2054" height="918" data-path="images/partner_31258016027156.png" />
           </Frame>

           <Note>
             Some mandatory fields associated with an Activity in Salesforce do not appear on the mapping page under the mapping section. You need to manually add these. Refer to the [FAQs](#frequently-asked-questions) for more details.
           </Note>

    3. Click **Save**.
  </Step>
</Steps>

##### Mapping user attributes to Salesforce fields

When enabling Streams on the MoEngage App Marketplace, you can select the user attributes that need to be synced to Salesforce. These attributes can be accessed within the mapping using:

```text theme={null}
user_attributes.{user_attribute_name}
```

This can then be mapped to any field in Salesforce.

<Frame>
  <img src="https://mintcdn.com/moengage/cJSG0nHne5L3-Q_X/images/partner_32262625306772.png?fit=max&auto=format&n=cJSG0nHne5L3-Q_X&q=85&s=3a91b71c22ab2c9715905b184253cefa" alt="Mapping page in the MoEngage Salesforce app with a user_attributes path mapped to a Salesforce field" width="1452" height="178" data-path="images/partner_32262625306772.png" />
</Frame>

### Step 3: View activities in Salesforce

Open a contact to see all the activities sent through MoEngage.

<Frame>
  <img src="https://mintcdn.com/moengage/cJSG0nHne5L3-Q_X/images/partner_31258032483220.png?fit=max&auto=format&n=cJSG0nHne5L3-Q_X&q=85&s=3f1fdcc557f1b6668691149af9c1c25d" alt="Salesforce Contact record showing MoEngage activities in the activity timeline" width="738" height="776" data-path="images/partner_31258032483220.png" />
</Frame>

## Frequently asked questions

<AccordionGroup>
  <Accordion title="Some standard Salesforce fields are not getting updated. Why?">
    Some Salesforce fields are not writable, such as `MailingAddress`, `BillingAddress`, or location-type fields. Instead, map to the individual components of these fields — for example, mailing country, city, billing country, street, latitude, and longitude.
  </Accordion>

  <Accordion title="Why are some mandatory fields on standard Salesforce objects (Activities/Events, Tasks, Account) not visible during mapping?">
    In certain situations, mandatory fields for standard objects may not appear in the visible **Mandatory** section. If the fields do not appear, ensure that the respective fields are marked in the **Others** section of the mapping page.

    The following sections list the fields you must add in the **Others** section for each Salesforce standard entity.

    **Activity / Event**

    | When these fields are not available | Necessary fields to add in the *Others* section                                                              |
    | ----------------------------------- | ------------------------------------------------------------------------------------------------------------ |
    | Start and end date                  | `AssignedTo` (or `NameID`), `Subject`, `ActivityDate`, `Duration`                                            |
    | Activity Date Duration              | `AssignedTo` (or `NameID`), `Subject`, `Start Date`, `End Date`                                              |
    | Duration                            | `AssignedTo` (or `NameID`), `Subject`, `ActivityDate`, `AllDayEvent` (to mark the event as an all-day event) |

    **Task**

    | When these fields are not available | Necessary fields to add in the *Others* section |
    | ----------------------------------- | ----------------------------------------------- |
    | Subject                             | `Subject`                                       |
    | AssignedTo                          | `AssignedTo`                                    |

    **Account**

    | When these fields are not available                                                       | Necessary fields to add in the *Others* section |
    | ----------------------------------------------------------------------------------------- | ----------------------------------------------- |
    | Account Name (only applicable if Person Accounts is enabled for your Salesforce instance) | `Account Name`                                  |
  </Accordion>
</AccordionGroup>
