Skip to main content

setFormValue

Sets a form value. There are two different types of forms, such as named and unnamed. Named forms are stored in the memory and only persist until the application is fully closed, at which pooint they are removed. Unnamed forms are attached to the view where they are used and only persist until the view is destroyed, at which point they are removed.

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: Create a named form value.

Goal: Set value "Berlin" to the named form "adress" for the key "city".

Form, key and value have to be assigned within the params object of the action.

{
"type": "setFormValue",
"params": {
"form": "adress",
"key": "city",
"value": "Berlin"
}
}

Result:

The value "Berlin" is set to the named form "adress" under the key "city".

Example 2: Create an unnamed form value.

Goal: Set value "Germany" to the key "country" in an unnamed form.

Key and value have to be assigned within the params object of the action.

{
"type": "setFormValue",
"params": {
"key": "country",
"value": "Germany"
}
}

Result:

The value "Germany" is set to the key "country" in an unnamed form.