ObjectStackObjectStack

Action

Action protocol schemas

Action Parameter Schema

Defines inputs required before executing an action.

Two declaration modes:

  1. 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

]
  1. Inline (legacy / bespoke) — declare name, label, type etc.

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_toolbar
  • list_item
  • record_header
  • record_more
  • record_related
  • record_section
  • global_nav

ActionParam

Properties

PropertyTypeRequiredDescription
namestringoptional
fieldstringoptionalSnake case identifier (lowercase with underscores only)
objectOverridestringoptionalSnake case identifier (lowercase with underscores only)
labelstringoptionalDisplay label (plain string; i18n keys are auto-generated by the framework)
typeEnum<'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
requiredboolean
optionsObject[]optional
placeholderstringoptional
helpTextstringoptional
defaultValueanyoptional
defaultFromRowbooleanoptional

ActionType

Allowed Values

  • script
  • url
  • modal
  • flow
  • api
  • form

On this page