Journey Manager (JM) The transaction engine for the platform. MaestroThe UI design product. | Form BuilderPlatform Developer | 17.10 This feature was updated in 17.10.
Maestro allows you to use reference data to implement autocomplete of fields in Maestro forms. For this to happen, you must create reference data in Manager first.
Let's illustrate this with a simple Maestro form that has a single autocomplete field pre-populated with a list of Australian postcodes by the Form Load rule. We use the sample postcode reference data created with the Australian Postcodes JSON file and the en_AU locale. For more information, see Fields Lookup with Reference Data.
suburb
.data.$postcodes
as shown below: data.$postcodes
:Transact.referenceData("Australian Postcodes JSON", null, "en_AU").then(function(response){
data.$postcodes = JSON.stringify(response.filter(function(row) {
row.label = row.suburb + ', ' + row.state + ' ' + row.code;
return true;
}));
}).catch(function(error) {
// handle the exception
});
The Form Load rule JavaScript calls Transact.referenceData
to fetch the JSON-formatted reference data stored in Manager.
When the promise fulfills, the code in the then
handler receives an array in the response parameter and filters each row o the array to produce an additional composite property called label
, which formats the suburb
, state
and code
properties into a well-formatted string. The filtered array is stored in data.$postcodes
.
Properties in the form data object that begin with $
are not sent to Manager with the form XML.
Now, you can check that autocomplete functionality works.
Next, learn how to use reference data with JavaScript Library.