Form-level actions in Settings

The Settings tab stores reusable Code action definitions and the Form validator. Saving a Code action does not run it; a button or another component event must reference that action.

Settings vs button Actions

Workspace zones: left Settings tab and right button Actions.Workspace zones: left Settings tab and right button Actions.
WhereWhat it does
SettingsActionsStores reusable Code action definitions
Selected component → ActionsAttaches actions to a component event
SettingsForm validatorRuns validation across the entire form

Field-level validation still lives on each field’s Rules tab.

Open Settings

Settings tab on the left panel.Settings tab on the left panel.
  1. Click Settings on the left panel.
  2. Scroll to the Actions block.

Add a form action

Settings Actions block with an arrow pointing to Add a code action.Settings Actions block with an arrow pointing to Add a code action.
  1. Click Add a code action.
  2. The bottom panel opens the code editor for the new form action.
Bottom panel code editor open for a new form-level code action.Bottom panel code editor open for a new form-level code action.
  1. Enter a Name, write or paste the script, and click Save.
  2. Select the button or other component that should run the action.
  3. Open its Actions tab and click Add an action under the event you want to use, such as onClick.
  4. Open Code and select the saved action by name.
  5. Coordinate with developers for production logic.

Form validator (optional)

Form validator block with an arrow pointing to Edit code.Form validator block with an arrow pointing to Edit code.
  1. In Settings, find Form validator.
  2. Click Edit code.
Bottom panel code editor open for Edit form validation code.Bottom panel code editor open for Edit form validation code.
  1. Edit validator code only when your team assigns you that task. Many teams restrict this to developers.
  2. Click Save when finished.

Test

Preview with Data and Errors panels.Preview with Data and Errors panels.
  1. Click Preview.
  2. Trigger the component event to which you attached the action.
  3. Use Preview mode tools to inspect Errors.

Summary

Settings stores reusable Code actions and the Form validator. Attach a saved action to a component event on the right, then trigger that event in Preview.

See also