Skip to main content
Version: 4.62

setFormValue

Sets a specified value to a form layer with the specified name (key).

Field Configurations

KeyTypeDescriptionDefault Value
"params" (required)Objectundefinednull

Parameters

KeyTypeDescriptionDefault Value
"async"BooleanSpecifies whether the action should perform asynchronously.null
"form"StringName of the form (Only for named forms).null
"key" (required)StringName of the form value.null
"value" (required)StringValue of the form value.null

Inherited

From Base Action

Base Action

Field Configurations

KeyTypeDescriptionDefault Value
"dynamicParams"ObjectDynamic params to retrieve data from a specific context e.g. a userSetting.null
"leadingDelimiter"StringThe leading mustache delimiter to use.null
"params"Object,ArrayObject containing the properties of the action.null
"trailingDelimiter"StringThe trailing mustache delimiter to use.null
"type"StringType name of the action.null

Examples

Example 1: Set a form value

Show ExampleHide Example

Set the value for the specified form to the current year.

{
"type": "setFormValue",
"leadingDelimiter": "{$",
"trailingDelimiter": "$}",
"dynamicParams": {
"year": {
"left": {
"context": "date"
},
"transform": "formatDate",
"right": "YYYY"
}
},
"params": {
"form": "formActionsForm01",
"key": "formActionsValue01",
"value": "{$year$}"
}
}
The app showing the results of the sample code from Example 1.The app showing the results of the sample code from Example 1.

Example 2: Set multiple form values

Show ExampleHide Example

Set multiple values for different keys of the specified form.

{
"type": "setFormValue",
"leadingDelimiter": "{$",
"trailingDelimiter": "$}",
"dynamicParams": {
"year": {
"left": {
"context": "date"
},
"transform": "formatDate",
"right": "YYYY"
}
},
"params": {
"form": "formActionsForm02",
"key": "formActionsValue01",
"value": "{$year$}"
}
}
{
"type": "setFormValue",
"params": {
"form": "formActionsForm02",
"key": "formActionsValue02",
"value": "Berlin"
}
}
{
"type": "setFormValue",
"params": {
"form": "formActionsForm02",
"key": "formActionsValue03",
"value": "35390"
}
}
The app showing the results of the sample code from Example 2.The app showing the results of the sample code from Example 2.