Import transactions to Synerise

Published June 27, 2022
Modules
Difficulty
Selected Clients
rossmann logoccc logosharafdg logo

With Synerise you can process transactional data in many different ways. You can prepare advanced analysis or build marketing scenarios basing on them. You can also use transactions as a data set for AI engine.

This use case describes the process of transformation of a .CSV file with transactional data. The transformations performed on the file involve:

  • adding missing columns with currency code
  • creating eventSalt for the transactions
Note: The eventSalt parameter enables to deduplicate transactions when two or more are sent with the same eventSalt and time as the original transaction.

After the transformation, the entries in the file will be imported to Synerise as transaction events.

Prerequisites


  • Save the file with transactional data to your computer. You can find the general requirements for the .CSV file format here. Make sure your file contains required columns. If any column is missing, it needs to be added later in the Data Transformation rules. Values of columns need to meet requirements of the transactional data structure used in Synerise.
  • Make a copy of the data file and remove rows from the copy until few are left. This copy will be used only as a sample for configuring the Data Transformation rules.
Click to see a sample CSV file used in this use case

client.email,orderId,paymentInfo.method,products.finalUnitPrice.amount,products.quantity,products.sku,recordedAt,revenue.amount,value.amount,products.name
test@test.pl,1234,cash,24,2,10000,2022-05-24T14:15:22Z,50,50,shoes
test@test.pl,1234,cash,26,2,20000,2022-05-24T14:15:22Z,50,50,dress

Process


  1. Prepare a data transformation diagram that will transform data from the .CSV file.
  2. Prepare a workflow that imports transactions to Synerise.

Create data transformation rules


In this part of the process, you define the rules of modifying data. The data transformation diagram which is the output of this part of the process is used later to automate sending the data.

The sample file is used to configure the data transformation diagram and preview its results. With a library of nodes, you can modify the file by adding, renaming, and merging columns, as well as editing the values in the rows, and so on.

In this example, we will use the Add column node to add columns with currency code and Merge columns to create eventSalt for the transactions

  1. Go to Automation icon Automation > Data Transformation > Create transformation.
  2. Enter the name of the transformation.
  3. Click Add input.

Add file with sample data

This node 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 Automation workflow, the system uses the rules created with the sample data as a pattern for modifying actual data.

  1. On the pop-up, click Add example.
  2. Upload the file with the sample data.
  3. Click Generate.

Result: The Data input view is filled with data from the sample.

Data input of the sample file
Data input of the sample file

Add columns

You can use the Add column node to create a new column to the file, with a defined value. In this example, there are no columns with currency codes in the input file so, following the transactions import requirements, we will add following columns: products.finalUnitPrice.currency, revenue.currency, value.currency. All of them will have the defined value: PLN.

  1. On the canvas, click the right mouse button.
  2. From the dropdown list, select Add column.
  3. Click the Add column node.
  4. In the configuration of the node:
    1. In the Add column field, enter the unique column name. In our case: products.finalUnitPrice.currency.
    2. Select the Static value option.
      The rows in the new column will be filled with the value you define.
    3. As the value, enter PLN
    4. Confirm by clicking Apply.
    5. Before you save the settings, you can check the preview of the file after changes on the Output data tab.
  5. Add two more Add column nodes by repeating steps 1-4 with the following changes:
    • as the second column, add revenue.currency and as the value to insert, enter PLN
    • as the third column, add value.currency and as the value to insert, enter PLN
Final configuration of the last Add column node, value.currency
Final configuration of the last Add column node that adds the value.currency column

Merge columns

You can use the Merge columns node to create a new column based on the values from other columns and to define the separator between the merged values. In this example, we want to add the eventSalt parameter to the transactions using this node. This parameter enables you to deduplicate transactions when two or more are sent with the same eventSalt and time as the original transaction. In our case, we will build this parameter by merging values of three columns: orderId, client.email, and recordedAt. We will add the - separator between the values.

Tip: We recommend to always use eventSalt parameter while importing transactional data.
  1. Click Add rule.
  2. Click Add column.
  3. From the dropdown list, select the columns to be merged: orderId, client.email and recordedAt.
  4. In the New column name field, enter eventSalt.
  5. In the Separator field, enter -.
  6. Before you save the settings, you can check the preview of the file after changes in the Output data tab.
  7. Confirm the settings by clicking Apply.
Final configuration of the Merge column node
Final configuration of the Merge column node

Add the finishing node

This node ends the transformation and passes the modified data to the automation where the Data Transformation is used.

  1. On the canvas, click the right mouse button.
  2. From the dropdown list, select Data output.
  3. In the upper right corner, click Save and publish.
    Result:
    The diagram of data transformation
    The diagram of data transformation

After the data transformation diagram is published, you can use it in the Data Transformation node while preparing a workflow that imports the files.

Prepare a workflow


The scenario for this use case involves a one-time transformation of a file uploaded from the user’s local storage. The transformed data will be imported to Synerise as transaction events.

  1. Go to Automation icon Automation > 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. Change the Run trigger option to one time.
    2. Select Immediately.
      The configuration of the Scheduled Run node
      The configuration of the Scheduled Run node
    3. Confirm by clicking Apply.

Select file to export

  1. Add a Local file node.
  2. In the configuration of the node:
    1. Upload the file in which you want to perform the transformation.
      Local file transfer
      Local file transfer
    2. Confirm by clicking Apply.

Select the data transformation rules

  1. Add a Data Transformation node.

  2. In the configuration of the node, select the data transformation you have created before.

    The configuration of the Data Transformation node
    The configuration of the Data Transformation node
  3. Confirm by clicking Apply.

Import transactions

  1. Add the Import transactions node.
  2. Confirm by clicking Apply.

Add the finishing node

  1. Add the End node.
  2. In the upper right corner, click Save & Run.
    Result:
    The workflow configuration
    The workflow configuration

You can monitor the flow of the workflow in the Transformation logs tab. It contains information about each execution of the workflow.

The logs for the workflow
The logs for the workflow

The imported transaction events will be visible in the customers’ profiles.

The transaction event visible in the customer's profile
The transaction event visible in the customer’s profile

Tip: This use case concerns one-time import of transaction events from the local storage. However, you can simply modify the flow and run import cyclically from external resource. Learn more how to set up the configuration of importing data from external resource at the following links: import from SFTP, import from HTTPS.

Check the use case set up on the Synerise Demo workspace


You can also check the Data Transformation diagram and the workflow configuration directly in Synerise Demo workspace.

If you don’t have access to the Synerise Demo workspace, please leave your contact details in this form, and our representative will contact you shortly.

Read more


😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker