JSON Filter

Cloud_Business.png

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

Use the JSON filter if your trigger receives JSON-encoded data. JSON filter allows you to use variables and values from your JSON file. The filter supports data extraction from JSON arrays.

Note

Automation allows you to use all JSON data types. Read more about the available JSON data types here.

While you can define the JSON file structure manually, Loftware recommends you to import the structure from the received JSON files.

To import the JSON file structure:

  1. Go to Data Filters and Edit your JSON filter.

  2. Click Structure > Import Data Structure. Navigate to your JSON file and click Open.

    After you import JSON files, the Data Preview section displays the JSON contents. The Data Preview also highlights the elements that you define as output fields.

For JSON data examples, see section JSON Data.

Defining Structure

To use the JSON items, configure them as:

  • Variable value: Specifies that you want to use the selected item as a field. When building the configuration, you manually map values with respective variables in the Use Data Filter action. For more information, see section Defining JSON Fields.

    • Optional element: Specifies that the element is not mandatory. The variable mapped to such field will have an empty value if the element does not appear in the JSON file.

  • Data block: Specifies that the included sub-items occur multiple times and provide data for your labels. Data block can be defined as repeatable area, assignment area, or both. In terms of JSON, the Data block works as an array.

    • Repeatable area: Specifies that you want to extract values from all repeatable data blocks, not just from the first one. You can define fields within each data block. Manually map the defined fields to the respective variables in the Use Data Filter action. For more information, see section Defining Repeatable Elements in JSON Filter.

    • Assignment area: Automatically creates the variables and assigns them relevant values. Field names and their values are read simultaneously. Mapping to variables is done automatically. Use this feature to accommodate the filter to changing input data, eliminating the maintenance time. For more information, see section Defining JSON Assignment Area.

The Data Preview section simplifies the configuration. The result of a defined filter rule is highlighted in the preview area.

To change the previewed JSON data, click Open and browse for a new sample JSON file.