This article will explain the steps that need to be taken to import content inside Datatrics. Using this import function profiles will be created from your data.
Here there are a couple of examples of Profile data you want to import can look like.
<?xml version="1.0" encoding="UTF-8"?>
<item> #element name used for the importer
id,name,description,price #The header of the CSV file
1,test name,short description,12.50 #A row with values
Start the import
To start the import go to project settings and press ‘Custom Importer’. The following page should become visible:
Click on the "Create Import" button to start the process and select "Content".
Choose between XML and CSV
As soon as you selected content, a new screen will open where you can choose between uploading a file (this must always be a CSV file) or Loading a file from an URL (this must always lead to an XML file).
Uploading a CSV file
To upload a CSV file, click on the large box "Drop file here or click to upload". This will open your computer's explorer to select a file. After selecting click on "Okay", the "Next" button in the top right will become available once the file is correctly uploaded.
Loading an XML file from a URL
For loading an XML file there are a number of fields that need to be filled in correctly.
In the field "Resource Location" a url must be placed that refers to a file in XML format. As soon as the content has been retrieved, the icon on the right of the input field will change to a green check mark. If something has gone wrong, an error message will appear. This may have something to do with the "Element" field.
An XML file consists of several elements that are put together in the file. Type the name of the element where a single content item starts. Then click “Enter” on your keyboard. This will fetch the file again.
When the XML file has been uploaded correctly a new element will be shown. In this element you can define how often the XML file should be updated.
Basic settings for the import
As soon as the chosen type of file is retrieved correctly, an overview will be displayed as shown in the figure below. Here you can enter a name for the import, what the item type is and you can choose (or create) the unique identification field of the item.
We accept several types of content. Below you can find an overview of the choices that are currently available.
Each item in Datatrics’ content has a unique identifier with which an item can be found. Depending on the header or keys found in the upgrade file you can choose one of these to be used as an id. Often these are already called "id" or "Product ID" in most feeds.
If there is no unique value in the file that can be used as a unique key, the Datatrics generated value can also be chosen.
Mapping the data
After choosing a name, id and type, the fields listed in the feed must be mapped or connected to the fields that will be used within Datatrics.
When the page is loaded, it will contain different rows depending on the loaded document. Every row has the following five columns:
You can find the explanation per column below:
1. Here you can indicate whether or not the field should be imported.
2. The name of the field according to the loaded file.
3. The name of the new field to be used within Datatrics. A name will be entered here by default. This is the name of the loaded file but without capital letters and no break spaces. Here is the possibility to give a name of your own, to leave the name as is, or to link one of the Datatrics fields to it by clicking on it. Using Datatrics fields as much as possible is strongly recommended. The Datatrics fields are the basic fields that are often used within the platform. These do not all have to be used, but use them where possible.
In the table below you can find the Datatrics fields.
A Datatrics field will always fix a type to the type expected for the field. As shown in the example below, this type cannot be changed because the field 'name' is a Datatrics exclusive field.
4. A piece of sample data from the uploaded file.
5. If you have entered your own field name, you can choose from a number of types to assign to that field.
Repeat these five options for all the rows! When all this is done you can click on the “Next” button in the top right corner.
Finish the import
The next page is the last page. It shows how many fields have been selected for the import and the name of the import.
Click on "Start Import" to finish the process.
Now wait for the process to be completed. This can take up to 15 minutes.
When the import is completed, the loading icon will change to a check mark and the total number of imported items will be displayed.
Finding your content
To view the imported data click on "content collection". This will take you to the content bin. The content should be visible here. Click on the collection with the name of the import to only see the items created by the import.