formData.setAdditionalValue
(FintechOS Studio 20.1.1 and later)
Defines an object that can be accessed in subsequent form steps.
Syntax
formData.setAdditionalValue(key: string, value: any): void
| Parameter | Description |
|---|---|
key
|
Object name. |
value
|
Object value. |
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 variable called start that holds the current time:
formData.setAdditionalValue('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() - formData.getAdditionalValue('start'));
For details on how to read an object that was defined in a preceding form step, see formData.getAdditionalValue.
For details on how to access the current record's attribute values, see formData.model.