MaestroThe UI design product. | Form Builder Platform Developer | 19.05 This feature was introduced in 19.05.
While building onboarding application forms, you can use various reference data to pre-fill and autocomplete form's fields, as well as validate user input against this data. Reference data is static data that is created and stored in Manager and it is pertinent to an organization, which Maestro forms, belonging to that organization, can access.
As we showed in Use Reference Data with Property Prefill, you can access reference data using property prefill. However, Journey Maestro also allows you to access reference data using the dynamic data service. In this case, reference data is stored and managed by running a custom Fluent Groovy service in Manager so it's made available at run-time when the form needs to fetch it as per a customer onboarding flow.
An advantage of this method is the potential ability to dynamically filter data. Reference data is still external to the form using this method, but it does require the creation of a service in Manager. A form builder needs to write code to persist the data and deal with different responses.
To illustrate how to use a dynamic data service, let's create a new Manager service which returns a JSON as a text, so you can call the new service from a form, using the form's load event, to populate a dropdown.
To use reference data with the dynamic data service:
Motorcycles.json
file as shown below:
String data = ''' [
{
"label": "BMW",
"value": "bmw",
"models": [
{"label": "F802GT", "value": f802gt, "years": [
{"label": "2008", "value": 2008},
{"label": "2017", "value": 2017},
{"label": "2021", "value": 2021}
]}
},
{
...
}]
'''
return data
ManufacturersDDS
.Manufacturers From DDS
.ManufacturersDDS
and change its Data Source to data.manufacturersdds
.DynamicData.call("Motorcycle Manufacturers", {}).then(function(response) {data.manufacturersdds = response;});
Next, learn how to use a cascading dropdown.