MaestroThe UI design product. | Form BuilderPlatform 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 JavaScript Library, you can access reference data using the JavaScript Library component. However, Journey Maestro also allows you to access reference data using property prefill. In this case, reference data is stored and managed by Journey Manager and injected into the form's XML data at the time of the rendering of the form. There is a non-trivial setup process required in Manager, but one benefit is that reference data remains external to the form. For more information, see form prefill for anonymous users. Be aware that prefilled data is returned along with other data fields in the submission XML, which can increase the size of data passed between a client and a server. For this reason, using prefill for reference data is not the ideal choice. For example, if your reference data is a list of country codes, you don't really what to have this data come back in the submission XML.
The reference data here is held in Manager as a Form Property. Before you can assign a value to a 'Property', you need to create a Property Type for it. To do this, follow these steps:
data.$tempManufacturers
.data.$tempManufacturers = JSON.parse(data.manufacturerspropertydata);
delete data.manufacturerspropertydata;
delete data.prefill.manufacturerspropertydata;
This rule converts the JSON formatted text value that is injected into the ManufacturersPropertyData
data field into a JSON object. Then, it saves the converted JSON object into a temporary data field $tempManufacturers
. It removes the manufacturerspropertydata
field from the form data object, so it will not be sent back in the submission XML. It also removes the manufacturerspropertydata
field from the form prefill data object, otherwise it will be merged back into the form data object before submission.
Form fields with names beginning with $
are not sent back in the submission XML data.
Motorcycles.json
file.
If you try to create a new property of the same Property Type in your form, you cannot do that. A Property Type can only be given a value by one Property in the same form.
Next, learn how to use reference data with a dynamic data service.