formData.formScope
(FintechOS Studio 20.1.3 and later)
Object shared between different JavaScript attributes of an entity form, used for storing variables and functions.
You can use it as a container to store and pass user-defined variables and functions between different steps of the same form or flow.
Examples
In this example, we track the duration in milliseconds between the time when a form is opened and the time the final form step (the Thank You screen) is displayed.
In the first form step's afterGenerate.js script, we define a formData.formScope attribute called start that holds the current time:
formData.formScope.start = new Date();
In the last form step's afterGenerate.js script, we save the duration in milliseconds passed since the first form step was opened in the elapsedTime attribute of the current record.
formData.model['elapsedTime'] = (new Date() - formScope.start);
For details on how to access the current record's attribute values, see formData.model.