> For the complete documentation index, see [llms.txt](https://docs.dinmo.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dinmo.io/integrations/destination-platforms/salesforce-marketing-cloud/synchronize-data-extensions.md).

# Synchronize data extensions

## Overview

In this destination service, DinMo will synchronise your data with an existing data extension or create a new one if it does not exist.

To create such an activation, you will need to go through these three steps:

* **If your data extension does not already exist**,
  * Click on *Create a new data extension* on the destination creation page.
  * Enter the following information:

    * The Data Extension name
    * The Data folder used by your data extension
    * The field used as primary key and its type

    <figure><img src="/files/OKYkKN9ghtGG0Dipl9rt" alt=""><figcaption></figcaption></figure>
* If your data extension already exists:
  * Create a Salesforce Marketing Cloud destination targeting this data extension. Refer to the [corresponding section](#destination-setup) for more info.
  * Create a segment or a model composed of all the rows that will populate the Salesforce data extension. The data extension's primary key must be one of the model's fields.
  * Activate the model or segment to the Salesforce destination to start sending data. Refer to the [corresponding section](#activation-configuration) for more info.

Each time the activation runs, DinMo applies records to the Data Extension according to the selected run type and sync mode.

## Destination setup

To start synchronizing objects, you are first required to create a Salesforce Marketing Cloud destination with the corresponding destination service.

In this process, you must specify:

* How data will be transferred:
  * Either using an FTP user. In this case, you must indicate the file transfer location (by default, `ExactTarget Enhanced FTP`)
  * Either through Amazon S3. In this case, you must again indicate the file transfer location.
* Which existing data extension will be updated in this destination. If you wish to update different data extensions, please create one distinct destination for each of these objects

### Configuring Amazon S3 Access

Amazon S3 Access requires you to input an AWS role ARN to give DinMo write access to your S3 bucket at the file transfer location.

In order to do so, you must add this role arn to the role's trust policy : `arn:aws:iam::724998534403:role/DinmoS3AccessorRole-dinmo-prod`

Here is an example of a trust policy with that role :

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::724998534403:role/DinmoS3AccessorRole-dinmo-prod"
            },
            "Action": "sts:AssumeRole"
        }
    ]
}
```

Here is a minimal policy granting s3 access to a role

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": "arn:aws:s3:::example-bucket"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetObject",
                "s3:PutObject",
                "s3:DeleteObject"
            ],
            "Resource": "arn:aws:s3:::example-bucket/*"
        }
    ]
}

```

**Important note:** The data extension must have a primary key configured on Salesforce's side.

{% hint style="info" %}
Learn how to create such a destination in our[ step-by-step tutorial](/guides/get-started-with-dinmo/initial-configuration-of-dinmo/create-a-destination.md)
{% endhint %}

## Activation configuration

Once the destination has been setup, and your DinMo model (or segment) created, you can create an activation to start sending data to Salesforce right away.

{% hint style="info" %}
Learn how to activate a segment in our [step-by-step tutorial](/guides/get-started-with-dinmo/create-and-activate-segments-on-dinmo/activate-your-first-segment.md)
{% endhint %}

### Run types and sync modes

When configuring a Salesforce Marketing Cloud activation, choose a run type and a sync mode. The available sync modes depend on the selected run type.

#### Run types

* **Full only**: Every run processes the full dataset.
* **Full then Delta**: The first run processes the full dataset. Later runs process only records that changed since the previous successful sync.

#### Available sync modes

| Run type            | Sync mode       | Behavior                                                                                              |
| ------------------- | --------------- | ----------------------------------------------------------------------------------------------------- |
| **Full only**       | **Mirror**      | Replaces the Data Extension content with the full set of records selected in DinMo.                   |
| **Full only**       | **Insert only** | Inserts records that do not already exist in the Data Extension. Existing records are left unchanged. |
| **Full then Delta** | **Insert only** | Inserts new records detected since the previous successful sync. Existing records are left unchanged. |
| **Full then Delta** | **Upsert**      | Inserts new records and updates existing records when their mapped values change.                     |
| **Full then Delta** | **Update only** | Updates existing records when their mapped values change. New records are ignored.                    |

{% hint style="info" %}

### Clear Data Extension Records

Choose when DinMo clears existing records from the Data Extension before loading data:

* **Never**: DinMo never clears existing records.
* **Full sync only**: DinMo clears existing records before the initial full sync only.
* **Always**: DinMo clears existing records before every sync.
  {% endhint %}

<figure><img src="/files/wHFCAzZ2GdYEkPXkD4rQ" alt="Salesforce Marketing Cloud activation configuration showing run type, sync mode, record clearing options, and field mapping." width="750"><figcaption><p>Configure the run type, sync mode, record clearing behavior, and field mapping for a Salesforce Marketing Cloud activation.</p></figcaption></figure>

### Fields mapping

In the Fields mapping section, you are asked to specify the field contained in your DinMo model corresponding to the primary key of the target data extension. This field will be used to link the model's records to existing records in Salesforce.

You can then map any other attribute existing in Salesforce. These attributes will then be updated by DinMo during each activation.

### Custom Attributes

In this section, any field you select will be automatically created and exported as a new column in your Salesforce data extension. The associated field will have the same name in Salesforce and DinMo.

The values of the attributes selected here will then also be updated at each activation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.dinmo.io/integrations/destination-platforms/salesforce-marketing-cloud/synchronize-data-extensions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
