Skip to main content

Control Event

In the details page of a record, whether creating a new record or editing an existing record, the system supports custom control events. These events allow different actions to be executed based on preset configurations when form data meets specific conditions, such as calling integrated APIs, etc.

The details page specifically refers to the page that appears when a user clicks the "Create Record" button to create a new record or opens the record details page by clicking on an existing record. It is worth noting that the control event feature will not be available when editing records, performing batch edits in views, performing batch editing operations, or adding records through data import or workflows.

Use Case

Using the membership field as an example, when a user selects "VIP1" as the membership level in a form, the system will automatically display the discount field as 5% off; if the user selects "VIP2" level, the discount field will automatically be displayed as 15% off. If the user does not select any membership level or clears the membership field, the discount field will not display any discount information. Such control event settings not only improve the efficiency of data entry but also ensure the consistency and accuracy of the data.

Configure control events

Click on the field in the form design area, then click the "Event" button on the right, and click "+ Event" to start configuring.

1. Select event type

Choose the event type "When value changes" because in the membership field, whether a user selects a membership level or clears the option, it changes the field value.

2. Configure event conditions and actions

Configure Condition 1 and the corresponding action: When a user selects VIP1 in the membership field, the discount field should be set to 5% off.

Condition Configuration:

Action Configuration:

3. Continue adding conditions and actions

Click the "Add Condition" button on the right of the event type to create a new set of conditions and actions.

Example:

Event Types

Currently supported event types include "When display or hide," "When the value changes," and "When getting or losing focus". Different control types support different event types.

Control TypeWhen displayWhen hideWhen getting focusWhen losing focusWhen the value changesWhen the value changes and loses focus
Input type🚫
Action type🚫🚫🚫
Read-only type🚫🚫🚫🚫
Selection type🚫🚫🚫
Relationship type🚫🚫🚫

Input type: Text, Number(number), Currency, Email, Telephone, Rich text, ID number

Action type: Number(progress bar and pedometer), Date, Time, File, Check items, Level, Positioning, Signature

Read-only type: Formula, Autonumber, OCR, API query(button), Barcode, Uppercase, Embedded, Query records, Foreign field, Rollup, Free link, Section, Tabs, Remarks

Selection type: Region/City, Single select, Multiple select, Members, Department, O-roles, API query(dropdown menu)

Relationship type: Relationship, Subform, Cascading

Event Actions

Currently, the actions that can be executed when an event occurs are as follows:

ActionsDescription
Show or hide fieldSpecify which fields to be shown or hidden when the event occurs (unlike business rules, this only takes effect at the time of the event)
Set field as read-only or editableSpecify which fields to be set as read-only or editable when the event occurs (unlike business rules, this only takes effect at the time of the event)
Set field valueUpdate the field value when the event occurs
Refresh field valueWhen the event occurs, refresh the field values (formula field, rollup field, concat field, etc.)
Call integrated APIWhen the event occurs, call a specified integrated API and map the returned value to the records in the current worksheet
Display messageShow a custom global message when the event occurs
Play soundPlay a specified sound or audio file when the event occurs

Event Conditions

When a control event occurs, users can set additional conditions that must also be met for the action to be executed. Multiple sets of conditions can be set under the same event. If one set of conditions is not met, it will continue to match the remaining conditions until a successful match is made, and the action corresponding to that condition is executed. Currently supported conditions include:

ConditionsDescription
By field valueWhen the event occurs, if the field value in the current worksheet meets the specified filter conditions, the action is executed
By querying the worksheetWhen the event occurs, if the expected query result meets the specified filter conditions, the action is executed
By custom functionWhen the event occurs, if a custom JavaScript code (which can reference fields in the current worksheet) returns true, the action is executed

Priority of Control Events, Field Properties and Business Rules

  1. The actions of all control events are executed in the order configured from top to bottom.
  2. After form loading is complete, the event actions of "When display" for each visible field will be executed in the order of the fields in the form layout. The actions within the events will be executed from top to bottom.
  3. Properties checked in field configuration (not set through business rules), such as "hide" or "read-only," can be modified to "display" or "editable" through events.
  4. For fields with "hide" or "display" actions set in business rules, if the visibility status of the field changes during the execution of business rules, the "When hide" or "When display" events configured for that field will be triggered.
  5. When control events and actions in business rules such as "display", "hide", "read-only", "editable" affect the same field, the event actions are executed first in sequence. Then, processing by merging business rules with "hide > show", "required > read-only > editable" when shown.

Have questions about this article? Send us feedback