Import transactions to Synerise
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
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.
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
- Prepare a data transformation diagram that will transform data from the
.CSV
file. - 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
- Go to Automation > Data Transformation > Create transformation.
- Enter the name of the transformation.
- 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.
- On the pop-up, click Add example.
- Upload the file with the sample data.
- Click Generate.
Result: The Data input view is filled with data from the sample.
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
.
- On the canvas, click the right mouse button.
- From the dropdown list, select Add column.
- Click the Add column node.
- In the configuration of the node:
- In the Add column field, enter the unique column name.
In our case:
products.finalUnitPrice.currency
. - Select the Static value option.
The rows in the new column will be filled with the value you define. - As the value, enter
PLN
- Confirm by clicking Apply.
- Before you save the settings, you can check the preview of the file after changes on the Output data tab.
- In the Add column field, enter the unique column name.
In our case:
- 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, enterPLN
- as the third column, add
value.currency
and as the value to insert, enterPLN
- as the second column, add
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.
eventSalt
parameter while importing transactional data.- Click Add rule.
- Click Add column.
- From the dropdown list, select the columns to be merged: orderId, client.email and recordedAt.
- In the New column name field, enter
eventSalt
. - In the Separator field, enter
-
. - Before you save the settings, you can check the preview of the file after changes in the Output data tab.
- Confirm the settings by clicking Apply.
Add the finishing node
This node ends the transformation and passes the modified data to the automation where the Data Transformation is used.
- On the canvas, click the right mouse button.
- From the dropdown list, select Data output.
- In the upper right corner, click Save and publish.
Result:
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.
- Go to Automation > Workflows > New workflow.
- Enter the name of the workflow.
Define the launch date
- As the trigger node, add Scheduled Run.
- In the configuration of the node:
- Change the Run trigger option to one time.
- Select Immediately.
- Confirm by clicking Apply.
Select file to export
- Add a Local File node.
- In the configuration of the node:
- Upload the file in which you want to perform the transformation.
- Confirm by clicking Apply.
Select the data transformation rules
-
Add a Data Transformation node.
-
In the configuration of the node, select the data transformation you have created before.
-
Confirm by clicking Apply.
Import transactions
- Add the Import Transactions node.
- Confirm by clicking Apply.
Add the finishing node
- Add the End node.
- In the upper right corner, click Save & Run.
Result:
You can monitor the flow of the workflow in the Transformation logs tab. It contains information about each execution of the workflow.
The imported transaction events will be visible in the customers’ profiles.
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.