Test Organization Reference Data

   Journey Manager (JM) The transaction engine for the platform.  |    System Manager / DevOps  |   17.10 This feature was updated in 17.10.

Manager allows you to test reference data of a selected organization, so you can quickly validate if filtering and sorting of reference data work as expected. This is handy while building or troubleshooting Maestro forms.

To test organization reference data:

  1. Select Forms > Organizations.
  2. Locate an organization and click Edit.
  3. Select the Reference Data tab to see all configured reference data sets.
    Manager organization reference data configuration.
  4. Choose reference data you want to test and click Query Test.
    Note

    This option is only available for CSV data type.

  5. Update a query request in the Query JSON field and click Test Query to execute it. The example query is shown below.
    {
    	"select": ["postcode","suburb","state","dc"],
    	"filter": [
    		{"field": "postcode", "operation": "match", "value": "2001"},
    		{"field": "suburb", "operation": "contains", "value": "E"}
    	],
    	"order": [
    		{"field": "suburb", "sortAsc": false},
    		{"field": "state", "sortAsc": true}
    	],
    	"fetchLimit": 50
    }

    For more information, see query syntax.

  6. Check a query result in the Query Result field.
    [
      {
        "postcode": "2001",
        "suburb": "SYDNEY",
        "state": "NSW",
        "dc": "GPO BOX CENTRE SYDNEY"
      }
    ]
  7. Click Load Example to upload a new query.
  8. Click Save Query to save the current query for the future use.

Query Syntax

A query you write to sort and filter reference data is a JSONJSON (JavaScript Object Notation) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays. object that is applied to the CSV data. You must adhere to valid JSON syntax, otherwise Manager throws an exception. For more information, see Introducing JSON.

The query object consists of four mandatory elements, which are listed below:

Element Type Description

select

array of string

The list of fields returned by a query.

filter

array of objects

A list of conditions to constrain the data returned by the query. Each filter condition is an object consisting of three elements: field, operation and value. The operation is used to perform a case-insensitive test of the field against the value, returning true for a successful test, and false otherwise.

order

array of objects

A list of sorting specifications that control the order of returned CSV rows. Each sorting specification is an object consisting of two elements: field and sortAsc.

fetchLimit

number

The maximum number of rows returned from the CSV file, applied after the filter and sort operations have been applied.

The select, filter and order array elements are constructed using the following mandatory elements:

Element Type Description

field

string

A case sensitive string matching a column heading in the first line of the CSV file.

operation

string

A case sensitive string, which must be one of the following: match, contains, startsWith, endsWith, greaterThan, lessThan, greaterThanEqual, lessThanEqual.

sortAsc

string

Specifies how an order specification is applied to the output; either ascending (true) or descending (false).

value

string

A case-insensitive string used by a filter condition to test against the values in the column specified by the field property.

Next, learn how to configure organization form categories.