Skip to content

Events on a Form

Form events run actions when something happens on a Factorial Form. To configure an event for a Form Field, open the field drawer and select the Events tab. Child sections also offer events for adding and deleting rows.

Alt text

Add a Form Event

Follow the below steps to configure a new form event for a field.

  1. Click on the Add button to add a new form event.
  2. Fill out the following details
Field Description
Name A suitable name for the event
Description A succinct description for the form event
Action Type The type of action to be triggered. 'Integrate' by default.
Action Trigger Define the scenario that triggers the event. Choose between:
1. When a key is pressed
2. When a field value is updated
Integration Choose the integration that needs to be executed. Refer Create Address Lookup integration to learn how an integration is configured through an example.
Inbound Integration Choose the inbound mapping of the selected integration. Refer [here](../examples/create-address-lookup-integration.md#^44acd6) to learn more from an example
Outbound Integration Choose the outbound mapping of the selected integration. Refer [here](../examples/create-address-lookup-integration.md#^2da4ac) to learn more from an example
Use Integration Result to Choose what the result of the integration needs to be used for. Either to:
1. Auto-populate the associated field
2. Populate another field in the Factorial Form

Alt text

  1. Click on Save & Close to save the event.

Set Field Value

Use a Set Field Value event to assign or clear another form field as part of an event pipeline. Common uses include applying a default, copying a value from another field, combining values into a formatted result, clearing a dependent field, or applying a value returned by reference data.

The available value source depends on the event configuration. A value can be fixed, read from another field, created from a template, derived from reference data, or cleared. If later events depend on the new value, link them after the Set Field Value event in the required order.

For a multi-select option set, each Set Field Value event adds one valid option key. Link consecutive events to add several options. Use a Clear event first when the existing selection must be replaced. See Multi-select option sets.

Build a concatenated value

Choose Concatenate as the Set Value Type, select the target field, and click Configure to open the Value Builder. Use the icon buttons below the preview to add literal text or a field value. Select a field and, where applicable, the value to use from that field. Drag rows to change their order. The blue preview shows the resulting text with friendly field names.

To insert a row in the middle, click that row's numbered selector, then click an add icon. The new row appears directly below it. Click the numbered selector again to clear the selection; new rows then go to the bottom. Save & Close requires every field-value row to have a selected field.

Build a math expression

Choose Math as the Set Value Type, select the result field, and click Edit expression. Add field, number, operator, and parenthesis rows using the icons below the blue preview. Drag rows to arrange the calculation. As in the Value Builder, select a numbered row to insert directly below it, or leave all rows unselected to add at the bottom.

The field picker offers numeric fields and string fields. For each field, you can set a Default value if empty. Its default appears in blue parentheses on the field row; the preview shows the field's name. A string field must contain a number when the form runs. If a value cannot be used as a number, the calculation does not replace the target field's existing value.

Use the Add, Subtract, Multiply, and Divide operators. Multiplication and division run before addition and subtraction; use parentheses to choose another order. Add an operator explicitly between values and parentheses. For example, arrange the rows as Field A, Multiply, Open parenthesis, Field B, Add, Number 4, Close parenthesis to calculate Field A × (Field B + 4). The target field can also be one of the source fields.

Save & Close checks the expression and highlights rows that need correction, such as two values without an operator or unmatched parentheses. A division by zero or a nonnumeric field value leaves the target field unchanged. The older Add and Subtract value types continue to change the target field by a fixed amount; choose Math for calculations using multiple fields or operators.

Field scope

The source field is the field whose pipeline is running. The target field is the field selected in the Set Field Value event.

Source scope Target scope Behavior
Root form Root form Updates the root target field.
Group row Same group row Updates the target in the current row without changing sibling rows.
Group row Root form Updates the root target field rather than adding the value to the row.
Root form Group row Not supported because there is no current row to select.
Group row Different row or different group Not supported. The event does not guess which other row or group to update.

When the target field has its own On Update pipeline, that pipeline uses the target's scope. A same-row target retains the current row context; a root target uses root context.

For grouped fields, keep row-level sources and targets in the same grouping section. Use an integration or another explicitly modelled operation when a process must select a different row or move data between different groups.

Cache an integration response

An Integrate event can reuse a matching successful response within the current browser tab. This is useful for read-only Integration Workflows that return stable reference-like data or repeat an expensive query with the same inputs.

In the event's Browser response cache field, select a policy and set the Cache lifetime in seconds. The default lifetime is 300 seconds and the maximum is 86,400 seconds (24 hours).

Cache policy Read an existing response Store a successful live response Behaviour and typical use
Disabled No No Always execute the workflow. Use for commands, creates, updates, notifications, payments, or volatile data.
ReadOnly Yes No Use a valid matching response when one was stored by another event. On a miss or expiry, execute the workflow without storing the result.
WriteOnly No Yes Always execute the workflow and refresh the stored response. Useful for an explicit refresh action that primes later events.
ReadWrite Yes Yes Use a valid matching response; on a miss or expiry, execute the workflow and store the successful result.

Warning

Caching can prevent an Integration Workflow from running every time the event fires. Enable it only when reusing the response is safe and the workflow has no required side effects. The portal displays this warning but does not block the configuration.

The cache is scoped to the current browser tab by using browser session storage. It survives a page reload in the same tab, but it is not shared with other tabs and is discarded when the tab session ends.

A cached response is matched using the form token, signed-in identity (or anonymous scope), API environment, Integration Workflow, resolved input parameter values, and the form's system-properties context. Different inputs or security contexts do not share responses. These values are digested and are not written into the storage key.

Only successful responses are stored. Successful empty results are valid cache entries. Missing, expired, invalid, failed, or error-bearing responses fall back to a live Integration Workflow call. Identical simultaneous misses are combined only for policies that read from cache.

In the form debug console, use Clear Integration Cache to remove cached Integration Workflow responses. Clear App Caches also removes them. Select Disable Integration Cache in the debug console to bypass both cache reads and writes while troubleshooting; changing this setting also clears existing cached integration responses.

Execution mode

An event's Execution mode defaults to Blocking. Blocking waits for the event to finish before the next event starts. Forms without this setting also run blocking. Non-blocking starts the event and continues the event chain immediately. The event's own steps still run in order. Authored Integrate, Draft Submit, and Set Field Value events support non-blocking mode. Generated events always run blocking, and unsupported configurations are rejected when the form is saved or published.

Event Supported modes Why and what to consider
Integrate Blocking or non-blocking Use non-blocking only when following events do not need its response, populated fields, or dataset. Async responses may arrive after navigation or after another event changes the same field; check for stale values and display rules. Keep it blocking when it supplies a prerequisite.
Show Modal Blocking only A following event may rely on the modal being visible and its interaction state being established.
Navigation Blocking only Navigation can replace the form, trigger a save or submit, or change which event chain should run next.
Draft Submit Blocking or non-blocking The event keeps its internal save-before-submit order. With non-blocking mode, later events, including navigation, start before submission finishes; a failure cannot stop them. Consider duplicate clicks, destination-page edits, submission modals, and failure recovery. If navigation changes the form before its save completes, submission is skipped and an error is shown. A full browser unload can interrupt the request.
Set Field Value Blocking or non-blocking Use non-blocking when the parent chain can continue while the field update and its child On Update chain finish. Keep it blocking when later events need the new value or display-rule effects, or when a scope or value error must stop the parent chain. Concurrent updates to the same field or shared display rules can finish out of order. A later error cannot stop parent events that have already started.
Auth Scope Upgrade Blocking only The authentication change and form reload must finish before the continuation runs.
Data Store Poll Blocking only Later events may depend on the poll result or the fields populated from it.
Conditional Blocking only Its result selects the next branch; the chain cannot advance until that choice is known.
Refresh Reference Data Query Blocking only Later events may consume the refreshed record through fields, display rules, or integration mappings.
Forward to Host Blocking only The host message and its order relative to following events must remain predictable.
Close Modal Blocking only Validation or modal dismissal can govern whether following actions should run.
Trigger Form Validation Blocking only Validation failure stops the chain and must be known before a save, submit, or navigation.

Place a blocking prerequisite immediately before an event that needs its result, or group dependent work within one handler. Non-blocking refers to the event chain; submit modals and other interaction locks still follow their own settings. A child On Update chain triggered by Set Field Value runs within that event and follows its own event modes. A child failure cannot retroactively stop a parent chain that has already advanced.

Run events when child section rows change

Open a child section's Events tab to configure actions in these pipelines:

Pipeline When actions run
On Before Add Row Before a user adds a row.
On After Add Row After the row has been added.
On Before Delete Row Before a user deletes a row.
On After Delete Row After the row has been deleted.
On Row Count Change After the number of rows changes.

Use On Before Delete Row to add Show Delete Confirmation Dialog. A new child section includes this action by default. If the user cancels or closes the dialog, the row stays and later actions in that delete pipeline do not run. Place a Condition before the confirmation action when only some deletions need a prompt. For example, create a Child Section Rows rule with Total Rows equals 1, select the same child section whose delete event you are editing, and link the condition's Yes path to the confirmation action. The dialog then appears only when deleting the last row. Leave the No path without a confirmation action to allow other rows to be deleted directly.

To customise the prompt, open the child section's Additional Properties tab and use Delete Confirmation Dialog Template. The Override switch lets you configure a section-specific template. Without an override, the form or theme template applies.

For On Row Count Change, add and order the actions to run when a row is added or removed. The event runs for rows added by the user, rows created automatically, and the section's configured initial rows. Initial-row events run after the form has finished loading. Opening an existing form does not replay events for its already saved rows.

A cancelled removal does not run the event. If a row contains a document that cannot be deleted, the row remains and the event does not run. A change to a value inside an existing row does not change the row count; use a field event or a condition for that case.