XML Filter

To learn more about filters in general, see section Understanding Filters.

Use this filter whenever a trigger receives XML-encoded data. The filter allows you to extract individual fields, fields in repeatable sub areas, and even name-value pairs. XML structure defines elements and sub elements, attributes and their values, and textual values (element values).

While you can define the structure of the XML file by yourself, NiceLabel recommends you to import the structure from the existing sample XML file. Click Import Data Structure button on the ribbon. After you import the XML structure, the Data Preview section displays the XML contents. It also highlights the elements and attributes that you define as output fields.

For XML data examples, see section XML Data.

Defining XML Fields

If you define XML fields, you make values of selected items automatically available. Filter definition makes such fields available for mapping to variables in actions. This allows you to extract values of elements or attributes.

To define an item value as field, do the following:

  1. Select the element or attribute in the structure list.

  2. For Usage, select Variable value.

  3. The item is displayed on the structure list with bold letters, indicating that it is in use.

  4. The element or attribute name is used as output field name.

  5. The Data Preview section highlights the value of the selected item.


Defining Repeatable Elements in XML Filter

If an XML element occurs in XML data for multiple times, it is a repeatable element. Usually, a repeatable element contains data for a single label. To indicate that you want to use data from all repeatable elements, and not just from the first one, define the element as a Data block and enable the Repeatable element option. If the filter contains definition of elements defined as data block / repeatable element, the Use Data Filter action displays repeatable elements with nested placeholders. All actions nested below such a placeholder execute only for data blocks at this level.

Defining XML Assignment Area

XML filter automatically identifies fields and their values in the received data. This eliminates the need for manual variable-to-field mapping.