Files can be imported into a related data set in either XML or CSV format.

Prerequisites​

  • To import a CSV file, it is necessary to create columns in the related data set out of the structure used in the data (see Create Columns of Related Data Sets During Import). This must be done before the data is imported. With an XML file, both the structure (that is, the columns of the table) and the data can be added during import.

  • This structure can be created in the user interface of Mapp Engage (see Create Columns of Related Data Sets During Import).
    The structure can also be created during data import.

  • Related Data table columns are case-sensitive. This means that column names in the import file must exactly match the names in the Related Data table, including capitalization. For example: a Related Data column called OrderID will not be populated from a column named orderid in an import file.

  • The import file must contain a data column in addition to your key column. For example, if you have a table using an email address as a key, you cannot import a data file that only contains an email address and no other data. Any import files that only contain a key and no other data columns, will cause the import to fail.

  • The import file must not contain more columns than the Related Data table. Any Related Data import file that contains more columns than are specified in the Related Data table in Engage will cause the import to fail. This includes containing columns where the names from the file do not match the names in the Related Data table.

Please note, we have an upper limit of 2,000 characters for Related Data text columns. The searchable string (for use in Segmentation) is limited to 200 characters.

XML File​

The following example must be adapted to the structure created in the related data set.


Example:

<relatedData>
    <row key="123456">
        <column name="Productname">shoe</column>
        <column name="Date">11.01.2011</column>
        <column name="Price">10</column>
    </row>
    <row key="123457">
        <column name="Productname">Skirt</column>
        <column name="Date">15.01.2011</column>
        <column name="Price">20</column>
    </row>
</relatedData>
CODE
  • row key: This element represents a data record. All values that are included in the element are saved in a common row. The following tags describe the columns, that is, the individual data that belongs to this data record. The row key does not need to be set up as a column in the related data set. The row key can be linked to an attribute in order to create a connection between an attribute and a related data set. To check a data record, you can search for the entry in the row key. Depending on the settings when the data record was created, the entry is either row key unique or non-unique (for example, refer to Import Data Into Related Data Set).

  • column name ="<Name>": This tag marks a single piece of information that is stored in a data record. All tags must be created as a column in the data record. The column name must be identical to the created column name. The name can only contain letters and numbers. Spaces or special characters will generate an error. Depending on the character encoding of the data, different character encodings can be used in the tag. This encoding must also be indicated when importing the file into the related data set.
    For more information, see Import Data Into Related Data Set .

XML Files for Data Import and Building the Structure of the Container​

This example includes the <metadata> element which creates the structure of the related data set. The structure and data can be imported in a single XML file.

<relatedData>
    <metadata>  
        <columnDefinition name="Productname" type="String" default="shoe">
            <enum>shoe</enum>
            <enum>skirt</enum>
        </columnDefinition>
        <columnDefinition name="Date" type="date"></columnDefinition>
        <columnDefinition name="Price" type="String"></columnDefinition>
    </metadata>
    <row key="123456">
        <column name="Productname">shoe</column>
        <column name="Date">11.01.2011</column>
        <column name="Price">10</column>
    </row>
    <row key="123457">
        <column name="Productname">Skirt</column>
        <column name="Date">15.01.2011</column>
        <column name="Price">20</column>
    </row>
</relatedData>
CODE


  • <metadata>: shows the area for defining the file structure of the data record.

  • column Definition: this tag marks the area for defining the data column.

  • name: this determines the name of the column. This must correspond to the entry used for file transfer in the attribute key. The name of the data column can only contain letters and numbers. Spaces or special characters generate an error.

  • type: this attribute determines the type of data:

    • number: only numbers can be saved in the column

    • date: only data in the form of dates can be transferred. The following date formats are possible:
      DD.MM.YYYY
      YYYY-MM-DD
      YYYY-MM-DD HH:mm:ss
      You can also use any ISO standard format, for example:
      YYYY-MM-DD'T'HH:mm:ss (e.g. 2012-06-27T10:45:44)
      YYYY-MM-DD'T'HH:mm (e.g. 2012-06-27T10:45)

    • string: strings of numbers can be saved

    • Boolean: entries can only have the value true, false or empty

  • enum: This tag creates an enumeration (that is, all possible values are defined). All possible values of the enumeration are listed in the tag.

After the metadata are defined, the data set to be imported can be specified.


Data type: Number​

  • Default-Value: Input field for a value that will always be entered when no other value is entered in the column. This input field does not have to be filled out.

  • Generate enumeration: This selection creates a numeration. Numbered columns only allow import of values defined in advance.

  • Add value for enumeration: This input field allows entry of the values that can be entered in the numbered columns. Clicking on the button + opens a further input field opens and saves the value.

CSV files​

The CSV file must contain the column names that were created in the related data set in the first row. The first column is always the identifier for the data record. This identifier is not created in the related data set when the structure is being built

For more information, see Import Data Into Related Data Set.

Example:

            Key, Purchase-ID, Article, Price
"123456","123","jacket","179,95"
"123457","124","shirt","99,95"
"123458","125","trousers","119"
          


 The names displayed in the first row correspond to the columns created in the related data set. The character used to separate the fields/columns can be freely chosen but must be configured appropriately when the file is imported.

Moreover, it is recommended to use the field delimiter " to enable the use of special characters in the data records. In addition, the correct character encoding must be selected when saving the file so that the imported file can be displayed correctly. This character encoding must be indicated when importing the file into the related data set.

For more information, see Import Data Into Related Data Set.