## Related terms

- workflow
- segmentation
- data\-transformation
- node
- profile
- attribute
- marketing\-agreement
- automation\-module

See the [glossary](/glossary.md) for definitions.

---

# Efficiently Sync Customer Data Across Multiple Platforms Using Automation


If you manage the customers' data in several places at once, you can use  Automation Hub to synchronize it. It's possible thanks to the HTTPS and SFTP integrations that allow you to send data from Synerise to external sources and the other way round.  

This use case describes how to prepare an automated workflow that launches every day and sends the updated list of customers with the agreement for email communication from Synerise to an external resource using the SFTP protocol.

One of the challenges addressed in this use case is modifying the value of the customer attribute (a newsletter agreement attribute) so the data structure is consistent. 

## Prerequisites
---
- You must have customers in **Behavioral Data Hub > Profiles**.  
- You must have a target resource with which you synchronize the data (in this use case, an SFTP server is used).

## Process
---
1. [Create a segmentation of customers](/use-cases/synchronize-profile-data-with-external-services#prepare-a-segmentation) whose data you want to send to the external resource.
2. [Prepare a transformation](/use-cases/synchronize-profile-data-with-external-services#prepare-a-transformation) to modify the data to meet the requirements of the external resource data structure.  
3. [Prepare a workflow](/use-cases/synchronize-profile-data-with-external-services#prepare-a-workflow) that sends the data of customers from Synerise to the external resource.

## Prepare a segmentation
---
As the first part of the process, create a segmentation of customers who agreed to receive emails. Data of these customers will be sent to the external resource.

1. Go to <img src="/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/icons/decision-hub-icon.svg" alt="Decision Hub icon" class="icon" > **Decision Hub > Segmentations > New segmentation**.  
2. As the name of the segmentation, enter `Subscribers`.  
3. Click **Add condition**.
4. From the dropdown list, select `newsletter_agreement`.  
5. As the logical operator, select **Equal**.  
6. In the text field, enter `enabled`.  
7. Click **Save**.

    <figure><img src="/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/synchronize-segmentation.png" class="full" alt="The configuration of the segmentation"><figcaption>The configuration of the segmentation</figcaption></figure>

## Prepare a transformation
---

In this part of the process, you define the rules of modifying data before sending it to the SFTP server, so the data is consistent. For the purposes of this case, a `newsletter_agreement` parameter value will be changed from `enabled` to `true`. Additionally, we add a parameter which marks data as imported, so this import can be distinguished in the SFTP server.  

The transformation which is the output of this part of the process is used later to [automate sending the data](/use-cases/synchronize-profile-data-with-external-services#prepare-a-workflow).  


### Prerequisites
You need a sample of data that will be used in data transformation. You can add it in two ways:
- Prepare a `.csv` file with a few columns and example values.  
    
  <details class="accordion"><summary>Click here to see an example file</summary><div class="accordion-content"><pre><code class="language-plaintext">clientId,email,newsletter_agreement 111111111,john.doe@synerise.com,enabled 222222222,kathy.smith@synerise.com,enabled 333333333,lily.novak@synerise.com,enabled 444444444,matt.turner@synerise.com,enabled</code></pre></div></details>

- Export several customers from **Behavioral Data Hub > Profiles** to a `.csv file`.
    
  <details class="accordion"><summary>Click here to read the instructions</summary><div class="accordion-content"><ol> <li>Go to <strong>Behavioral Data Hub &gt; Profiles</strong></li> <li>On the list, select several customers.</li> <li>At the top of the list, click the <strong>Export</strong> button.</li> <li>On the pop-up, enter the name of the export.</li> <li>Select three attributes: <strong>email</strong>, <strong>clientId</strong>, and <strong>newsletter_agreement</strong>.</li> <li>Click <strong>Apply</strong>. </li> <li>On the pop-up, click <strong>Go to Reports</strong>. </li> <li>On the list, find your export. </li> <li>Next to the export, click the <img src="/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/icons/threedoticon.svg" alt="Three dot icon" class="icon" > icon. </li> <li>From the context menu, select <strong>Download</strong>.<br><strong>Result</strong>: A `.csv` file is downloaded.</li> </ol></div></details>


1. Go to <img src="/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/icons/automation-hub-icon.svg" alt="Automation Hub icon" class="icon" > **Automation Hub > Transformations > New transformation**.  
2. Enter the name of the transformation.  
3. Click **Upload a new file or drag one here**.  

### Add file with sample data

This step allows you to add a data sample. In further steps, you define how the data must be modified. Later, when this transformation is used in the workflow, the system uses the rules created with the sample data as a pattern for modifying actual data.

1. Upload the file with the sample data.  
2. Set **Delimiter** and provide **Quotation mark** and **Escape character**.
3. Click **Apply**.  

 <figure><img src="/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/synchronize-data-input.png" class="full" alt="Transformation file upload showing sample data for profile synchronization with external services"><figcaption>The configuration of the file upload</figcaption></figure>

### Edit the newsletter_agreement value

The **Edit Values** step allows you to replace the `enabled` value of the `newsletter_agreement` attribute with `true`.

1. On the right panel, click **Add step**.  
2. From the dropdown list, select **Edit Values**.
3. Click the **Edit Values** step.  
4. In the configuration of the step:  
    1. Select the **newsletter_agreement** column.  
    2. Under **Edit values by**, from the dropdown list, select **Replacing**.  
    3. In the dropdown below, leave the **Static value** option at default.  
    4. In the text field, enter `true`.  
    5. Confirm by clicking **Apply**.

 <figure><img src="/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/synchronize-edit-values.png" class="full" alt="The configuration of the Edit Values step"><figcaption>The configuration of the Edit Values step</figcaption></figure>  

### Add the parameter which marks data as imported

The **Add Column** step allows you to add a column to the data. As a result, you can easily identify the import in the external source (the SFTP server).

1. On the right panel, click **Add step**.  
2. From the dropdown list, select **Add Column**.    
3. In the configuration of the step:  
    1. In the **Add Column** field, enter `importType`.  
    2. In the dropdown, select **Static value**.  
    3. In the text field, enter `synerise_subscribers`. 
    4. Confirm by clicking **Apply**.

    <figure><img src="/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/synchronize-add-column.png" class="full" alt="The configuration of the Add Column step"><figcaption>The configuration of the Add Column step</figcaption></figure> 

### Preview and save the transformation

1. Preview the results in the **Output** tab.  
    <figure><img src="/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/synchronize-output-data.png" class="full" alt="The preview of modifications to the file"><figcaption>The preview of modifications to the file</figcaption></figure>
2. In the upper right corner, click **Save**.  
 
    <figure><img src="/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/synchronize-data-transformation.png" class="full" alt="Transformation for synchronizing customer profile data with external services"><figcaption>The transformation configuration</figcaption></figure>


## Prepare a workflow
---
As the final part of the process, create a workflow which sends the customers' data every day to the external source using the SFTP protocol. 

1. Go to <img src="/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/icons/automation-hub-icon.svg" alt="Automation Hub icon" class="icon" > **Automation Hub > Workflows > New workflow**.  
2. Enter the name of the workflow.  

### Define the launch date

1. As the trigger node, add **Scheduled Run**.  
2. In the configuration of the node:  
    1. Select the **Repeat runs** option.  
    2. From the **Timezone** dropdown list, select the time zone consistent with the timezone selected for your workspace.  
    3. Define the frequency of the workflow (for example, every day at 6.00 A.M.).  
    The workflow will automatically launch every day at 6.00 A.M. 
    4. Confirm by clicking **Apply**.

<figure><img src="/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/synchronize-scheduled-run.png" class="full" alt="Automation Hub Scheduled Run node configuration for triggering profile data synchronization with external services"><figcaption>The configuration of the Scheduled Run node</figcaption></figure>

### Select customers to export

1. Add a **Get Profiles** node.  
2. In the configuration of the node:  
    1. Select **Segments** and then the segmentation you [created in the first part of the process](/use-cases/synchronize-profile-data-with-external-services#prepare-a-segmentation).  
    2. In the **Attributes values** section, select **newsletter_agreement** and **email**. 
    3. Confirm by clicking **Apply**.  

   <figure><img src="/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/gsc-get-profiles.png" class="full" alt="Automation Hub Get Profiles node selecting customers by segmentation with newsletter agreement and email attributes for external service synchronization"><figcaption>The configuration of the Get Profiles node</figcaption></figure>

### Select the transformation

1. Add a **Data Transformation Studio** node.  
2. In the configuration of the node, keep the default **From workflow context** option.
3. In the editor, click **Templates library**:
    1. Select the [transformation you have created before](/use-cases/synchronize-profile-data-with-external-services#prepare-a-transformation).
    2. Click **Use template**.
4. Confirm by clicking **Apply**.  

 <figure><img src="/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/synchronize-auto-data-trans.png" class="full" alt="The configuration of the Data Transformation Studio node"><figcaption>The configuration of the Data Transformation Studio node</figcaption></figure>


<div class="admonition admonition-tip"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" /></svg></div><div class="admonition-body"><div class="admonition-content">

You can also create a transformation directly in the **Data Transformation Studio** node instead of selecting a template.

</div></div></div>


### Configure settings for SFTP protocol

1. Add the **Send File** node by clicking **THEN > SFTP - Send File**.  
2. In the configuration of the node:  
    1. Select the SFTP connection type as **Public key**, choose the connection in the **Select connection** field, and click **Next**.
    2. Enter the path to your server.  
    3. Select the port.
    4. Enter the path to the directory.
    5. Enter the name of the file.  
    6. If needed, in the **File name suffix**, select the suffix of the file name.  
    7. From the **File format** dropdown list, select the **CSV** format.  
    8. Verify and modify the delimiters if needed.  
    9. Confirm by clicking **Apply**. 
    
      <figure><img src="/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/synchronize-sftp.png" class="large" alt="The configuration of the SFTP Send File node for exporting profile data"><figcaption>The configuration of the SFTP Send File node</figcaption></figure>

### Add the finishing node

1. Add the **End** node. 
2. In the upper right corner, click **Save & Run**.  
    **Result**:  
    <figure><img src="/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/use-cases/all-cases/_gfx/synchronize-workflow.png" class="full" alt="Automation Hub workflow for synchronizing profile data with external services"><figcaption>The workflow configuration</figcaption></figure>

## Check the use case set up on the Synerise Demo workspace
---

You can check the configuration of each item created in this use case on our Synerise Demo workspace:  
- [Segmentation of customers who agreed to receive newsletters](https://app.synerise.com/analytics-v2/segmentations/7655038e-99bc-4876-9d7a-90f801ae6a5c).
- [Transformation](https://app.synerise.com/automations/data-transformation/19add353-ade6-406f-8e1c-db51229aa785).
- [The workflow](https://app.synerise.com/automations/automation-diagram/72a4d7e2-d2a0-40bd-a1a2-373bb7ae33b8).

If you’re our partner or client, you already have automatic access to the **Synerise Demo workspace (1590)**, where you can explore all the configured elements of this use case and copy them to your workspace.  

If you’re not a partner or client yet, we encourage you to fill out the contact [form](https://demo.synerise.com/request) to schedule a meeting with our representatives. They’ll be happy to show you how our demo works and discuss how you can apply this use case in your business.

## Generated events

This use case generates approximately 5 events per workflow execution:
[`automation.clientStartPath`](/docs/assets/events/event-reference/automation#automationclientstartpath) (~1), [`automation.clientPathStep`](/docs/assets/events/event-reference/automation#automationclientpathstep) (~3), [`automation.clientEndPath`](/docs/assets/events/event-reference/automation#automationclientendpath) (~1).

## Read more
---
- [Data Transformation](/docs/automation/data-transformation-and-imports/introduction)  
- [Segmentations](/docs/analytics/segmentations)
- [Workflows](/docs/automation) 
