Actions overview
Actions are what your app does when someone interacts with it: open a page, save a form, send an email, show a message. Every component that can be interacted with has events (such as "when clicked"), and each event holds an ordered action list . When the event happens, the actio
Actions overview
Actions are what your app does when someone interacts with it: open a page, save a form, send an email, show a message. Every component that can be interacted with has events (such as "when clicked"), and each event holds an ordered action list. When the event happens, the actions run one after another, from top to bottom.
You never write code. You pick an action from a menu, fill in a few fields (which page, which entity, which message) and MyAppBuilder runs it in the preview and in the published app.
When to use
- A button should take people somewhere: use Go to page, Open modal page, Open URL.
- A form should save data: use Create record or Update record on the form's onSubmit event.
- Something should happen in the background after a save: use Run workflow or let a workflow trigger react to the new record.
- You want feedback: Show message (a toast) or Show notification.
Events
Each component type supports some of these events. The Actions tab of the inspector lists exactly the ones available for the selected component:
| Event | When it fires |
|---|---|
| onClick | When clicked (buttons, icons, images set to "Run actions", clickable cards) |
| onSubmit | When a form is submitted, after validation |
| onSuccess / onError | After a form or login form succeeds or fails |
| onChange | When an input's value changes |
| onRowClick | When a row or item in a table, list, cards or gallery is clicked (the record is available as Event › record) |
| onLoad | When the page opens (edit it by clicking the empty canvas: "When the page opens") |
| onFocus / onBlur | When an input gains or loses focus |
| onOpen / onClose | When a modal or drawer opens or closes |
How to add an action
- Select the component on the canvas (for page-level actions, click an empty spot on the canvas).
- Open the Actions tab in the inspector on the right.
- Under the event you want, click Add action and pick one from the groups: Navigation, Data, State & UI, Logic, Communication & auth.
- Fill in the action's fields. Any field with a data picker accepts a fixed value, a record field, the current user, state, or a text template such as
Hello {{user.name}}. - Reorder with the arrows, delete with the bin icon. Actions run in the order shown.
- Open Preview to try it. Actions do not run on the editor canvas itself.
Browser actions and server actions
Actions fall into two groups, and you do not have to think about it, but it explains some behaviour:
- Browser actions run in the visitor's browser: Go to page, Go back, Open/Close modal and drawer, Refresh data, Upload file, Download file, Set state, Increase / decrease state, Reset form, Show message, Show notification, If / else, Wait, Repeat for each, Open URL, Copy text, Sign in, Sign out.
- Server actions touch data, secrets or email, so the server runs them: Create record, Update record, Delete record, Call API, Send email, Run workflow. The browser never sends the action's definition; it only sends a reference (which component, which event, which action) plus the values currently in scope (the form, the record, state). The server looks the action up in the configuration that user is allowed to see and runs it with that user's permissions. See Action permissions.
After a Create, Update or Delete record action, the data shown for that entity refreshes automatically. After Run workflow, all data refreshes.
Results and result keys
Some actions produce a value that later actions in the same list can use:
- Create record → the saved record (set Save result as, e.g.
customer). - Call API → the mapped response (e.g.
weather). - Upload file → the file's URL (e.g.
file). - Run workflow → the workflow's results.
Pick them in later actions with Result › key in the data picker, or write {{results.customer.id}} in a template. The most recent server-action result is also available as {{results.last}}.
onSubmit
1. Create record → Customers, use values from the form, save result as "customer"
2. Create record → Jobs, Customer = Result › customer.id
3. Show message → "Job created for {{results.customer.name}}"Conditions, loops and waiting
- If / else evaluates a condition (for example Current user › role is Staff) and runs the Then list or the Else list.
- Repeat for each takes a list (state, a query result, an API result) and runs its inner actions once per item, with the current item available as Event › item (
{{event.item.email}}). It stops after 100 items unless you raise the limit (maximum 500). - Wait pauses up to 30 seconds (30,000 ms) before the next action.
What happens on errors
If an action fails (the server refuses a save, an API is unreachable), the remaining actions in that list do not run and the visitor sees an error toast with the reason. On a form, the error is shown on the form and the form's onError actions run. Cancelling a Delete record confirmation simply stops the list silently.
Reference pages
Each action has its own page: Go to page, Go back, Open modal page, Close modal, Open drawer page, Close drawer, Create record, Update record, Delete record, Refresh data, Call API, Upload file, Download file, Set state, Increase / decrease state, Reset form, Show message, Send email, Show notification, If / else, Wait, Repeat for each, Run workflow, Open URL, Copy text, Sign in, Sign out.
Common mistakes
- Testing on the canvas. Actions are disabled while editing. Use Preview or the staging app.
- A form with both a "Saves to entity" setting and a Create record action. When the onSubmit list has actions, the form runs only those actions; it does not also save on its own. Tick Use values from the surrounding form on the Create record action.
- Expecting a result key from a browser action. Only Create record, Call API, Upload file and Run workflow produce results.
- Sending email to a dynamic address for anonymous visitors. Visitors who are not signed in can only email a fixed address.
Related
- Workflows overview for automations that run on their own.
- Bindings and State for the values you can use in action fields.
- Action permissions for what happens when a user is not allowed to do something.
Advanced
Server actions are executed by POST /api/runtime/:projectId/actions with { componentId, event, actionId, scope }. Rate limits per user or IP: record creation 60/min, API calls 60/min, workflow runs 30/min, emails 20/hour signed in and 5/hour anonymous. Templates are dotted-path lookups (record, user, form, results, event, params, query, state, pageState, component), never evaluated code.