Defining computed values
Each app can have some specific data transformations needed. Now this can be done via building service that handles this in js, but often times transformation is simple enough that it is easier to define it as a computed value in manifest.
Usage
In root level of the manifest, inside config
section, we can define computed_values
object.
Example:
In this example input value policy_start_date
will be updated whenever value active_policy.quote.customer_input.start_date
changes with the value it changed to.
update_when_changes
There are some cases where we don't want to update value when it changes. In those cases we can define dependency logic in update_when_changes
that will handle change detecton instead of value
.
Example:
In this example data.agents_count
input value will only update when input.data.additional_count
value changes. This would improve performance if input.data.agents
is static value and we don't want to listen for changes in there.
skip_form
All of the computed values will automatically update input
and form
state. By adding skip_form
property we can set this value to be only sent to input
.
Example:
In this example hello
value will only be set in input
state and not form
. Meaning this will not update field values in current screen without watch_changes
enabled on form.
Last updated