Links

Import Data

The data import node is used to import data into a specified list. The data that is imported is either in CSV, Excel, JSON or XML format. To use this node, simply drag it onto you flowchart and choose the right file format, JSON, XML or CSV/ Excel. Next thing you have to do is change.
Property
Description
Name
The name of the node. This cannot be changed .
Data source
When you click the button on the right hand side, you can select either a file or a text field from which the data has to be imported. This can be a field from another list, a field you access trough OData or through a Webservice.
Destination
Here you select the list into which the data has to be imported. When you click the list button, you can select the target list. This only applies to the CSV or Excel format.
Edit Mappings
When you click the Edit Mappings button, a new popup appears where you can define the mapping of the source to the target
This node has two exits:
  • Error- this exit is used when the import produces an error;
  • Default exit - this exit is used when the data import does not produce any errors.

Edit Mappings

The Edit Mappings screen is used to map fields from a source (like a CSV, Excel, Json or XML file) to fields that exist in WEM. Depending on the file format the mapping tool works differently.
Map CSV or Excel fields
The easiest way to create the mapping, is to hit the Create mapping from example button on the right hand side of the toolbar.
Data import
You can now select the CSV or Excel file you want to import, so WEM can learn which columns exist. Once the file is selected, WEM will show a list of all columns from the source file. You can now specify per column to which target field in WEM the data should be mapped / imported. Simply double click on the target field column for the specific CSV/Excel column and WEM will bring up the popup so you can select the actual target field. If needed you can also specify whether this should be a mandatory field and what do do when WEM encounters an invalid value in the source file.
Map Json or XML
To map Json or XML to WEM data, hit the Create mapping from example button on the right hand side of the toolbar to open the mapping tool. When you do this the first time you will get an emtpy screen: no mapping is available. You can create your own mapping by adding your own entities and map these to WEM fields. But it is far easier to use some sample Json or XML and let the WEM modeler do a lot of the work for you. Click on the Create mapping from example button in the toolbar en paste your sample Json on XML into this form. You can verify if you are using correct XML or Json and then click on Ok to let the system create the basic mapping.
When you use Json, you get something that looks like this:
Json import
For every array, object, text field, numeric field and boolean you can now specify:
  • Is this a mandatory component;
  • Do you want to skip an object if the data is invalid.
You can specify this by simply clicking on the component in the tree on the left hand side. You will then see the properties on the right hand side (see ths picture above). Te map a component to a WEM field, simply select the Json field, and in the properties area on the right click on the button of the Map to field. You will get a popup where you can select the WEM field to which you want the map the Json component.
Once you have done this for the entire Json message, you are done with the mapping: click on Save and your mapping is ready to use.
If you want to import XML, you get something that looks like the screen below, after you have created the mapping from an example:
XML import
The actual mapping works very similar to the Json mapping described above. The main difference is that the various XML elements can have different properties, based on the value of other properties of the same element. But in essence it works like Json mapping: you can create the entire mapping manually, or you simple import an XML example of the XML you want to import, so you can let the system create the basic mapping. Next, you go over each element and specify:
  • The Name (you usually don't change what the system created);
  • The Namespace of the XML element. If you use namespaces, you can select them here or create a new namespace;
  • Is it a repeating element? If so, you will get another property:
    • You can now specify the Target collection
  • Specify whether the element contains:
    • a single value. In this case you can specify where you want to Map the content to. You can select a field that is defined in WEM;
    • nested values (<catalog> or <book> in the example above). When this element contains nested values, you can't specify a mapping, because you should specify the mapping of the elements that are contained in this element.
The data export node is used to export data. When this node is dragged onto the workflow, you will automatically get a popup window where you have to select a list or list filter as the source from which you want to export the data. Next you edit the properties, so you can control the data export. The following properties are available:
Property
Options
Description
Name
The name of the node. The name is automatically set and cannot be changed.
Format
There are five options: - CSV - Excel (*.xlsx) - this is for the most recent Excel versions - Excel 97-2003 (*.xls) - this is for the older Excel versions - Json - XML
Select how you want to export the data
Source list '
Specify the list that is the source for the data export. This does not apply to XMLor Jsonexports.
Filter by
If you need to filter the data that wil be exported, you can add an expression that defines that filter.
Target field
Here you select the field where you want to store the exported data. This field has to be of the type File or Text (in case of XMLor Json).
Delimiter
There are four delimiters you can use: - Comma - Colon - Semicolon - Tab
This property is only available (and needed) when the format of the export is CSV. This property defines which delimiter should be used to separate the data.
Encoding
You can choose between 6 different character encodings: - ASCII - Windows-1252 - Latin 1 - ISO 8859-1 - UTF-8 - UTF-16 LE - UTF-16 BE
This property is only available (and needed) when the format of the export is CSV. The property makes it possible to select the character encoding you want to use for the data export
Include BOM
Sort by
When you click on this button you get to the Sorting popup where you can add expressions that make it possible to sort the exported data.
Edit Columns
The Edit Columns button takes you to the Data Export Maps editor.
This node has two exits:
  • Error- this exit is used when the export produces an error;
  • Default exit - this exit is used when the data export does not produce any errors.

Edit mapping

When you want to export to Json or XML, you need to specify a mapping to map the exported data to either Json or XML. This works the same as specifying the mappong for data import (see above for a description of how to create a mapping). The only difference is that the mapping will now be used to export data from your WEM application to Json or XML instead of importing data into your WEM application.