Action
Action protocol schemas
Action Parameter Schema
Defines inputs required before executing an action.
Two declaration modes:
- Field-backed (preferred) — reference an existing object field; the
runtime resolves the field's label (i18n), type, validation rules,
options, placeholder, help text, and widget mapping from object
metadata. Cross-object references use objectOverride.
params: [
\{ field: 'email' \}, // same object
\{ field: 'role', objectOverride: 'sys_member' \}, // different object
]
- Inline (legacy / bespoke) — declare
name,label,typeetc.
inline when no matching object field exists. Inline values may also be
used alongside field to override individual properties.
name is required unless field is provided (in which case it defaults
to the field name and is used as the request-body key).
Source: packages/spec/src/ui/action.zod.ts
TypeScript Usage
import { ActionLocation, ActionParam, ActionType } from '@objectstack/spec/ui';
import type { ActionLocation, ActionParam, ActionType } from '@objectstack/spec/ui';
// Validate data
const result = ActionLocation.parse(data);ActionLocation
Allowed Values
list_toolbarlist_itemrecord_headerrecord_morerecord_relatedrecord_sectionglobal_nav
ActionParam
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | optional | |
| field | string | optional | Snake case identifier (lowercase with underscores only) |
| objectOverride | string | optional | Snake case identifier (lowercase with underscores only) |
| label | string | optional | Display label (plain string; i18n keys are auto-generated by the framework) |
| type | Enum<'text' | 'textarea' | 'email' | 'url' | 'phone' | 'password' | 'secret' | 'markdown' | 'html' | 'richtext' | 'number' | 'currency' | 'percent' | 'date' | 'datetime' | 'time' | 'boolean' | 'toggle' | 'select' | 'multiselect' | 'radio' | 'checkboxes' | 'lookup' | 'master_detail' | 'tree' | 'image' | 'file' | 'avatar' | 'video' | 'audio' | 'formula' | 'summary' | 'autonumber' | 'composite' | 'repeater' | 'record' | 'location' | 'address' | 'code' | 'json' | 'color' | 'rating' | 'slider' | 'signature' | 'qrcode' | 'progress' | 'tags' | 'vector'> | optional | |
| required | boolean | ✅ | |
| options | Object[] | optional | |
| placeholder | string | optional | |
| helpText | string | optional | |
| defaultValue | any | optional | |
| defaultFromRow | boolean | optional |
ActionType
Allowed Values
scripturlmodalflowapiform