Skip to content

This page is for integrators and developers who read, create or execute entity buttons through the API, or who need to know exactly what happens when a button is clicked. It documents the stored model, its numeric enums, validation, the endpoints and the execution flow.

Internally a system button is not a bespoke collection: it is a regular DataEntry whose dataEntity is the built-in SYSTEM_BUTTON entity (StringConstants.SYSTEM_BUTTON_ENTITY_ID = 'SYSTEM_BUTTON', repository key SYSTEM_BUTTON_NAME = 'system_button'). This has two consequences:

  • Create / update / delete go through the generic data-entry CRUD for the system_button entity — not through the SystemButtonController. The dedicated controller only exposes read, status, options, and execute endpoints.
  • Buttons inherit DataEntry machinery: state, isInvalid, store, versioning, history, and space/store-based access scoping.

Source of truth: SystemButtonController (controllers/system-button.controller.ts), SystemButtonService (services/system-button.service.ts), and the models under models/system-buttons/.

Behaviour notes behind the designer options

Section titled “Behaviour notes behind the designer options”
  • Action types. The designer’s Action list groups the entity’s UI-level custom actions under Custom Action (RelevantActionTypeEnum.CustomEvent) and offers Navigation (Redirect) and Script under UI Action. Only CustomEvent buttons pass through the execute handler; Redirect and Script buttons are resolved in the client. Whether the bound reaction has a user interface is read from its custom action type being UI Since 1.8, rather than from a separate flag on the reaction. For deeper external logic, the reaction a button fires can in turn invoke a function.
  • Scope. actionTypes is a ButtonActionTypeEnum[]: SingleEntry, MultipleEntries and DataCollection. The designer offers Single Entry and Multiple Entries (multi-select); DataCollection (a list) is accepted by the API and the execute handler.
  • Custom-link tokens Since 1.8. Token bindings for a Navigation button’s URL are stored as redirection.urlTokensMap and interpolated into redirection.url at read time when an entryId is supplied. Each token’s value source is a TokenSourceType (Fixed, Field, Expression, Pointer). Token resolution is best-effort: a token that cannot be resolved (for example a field that no longer exists) is logged as a warning and the button falls back to the original, unresolved link text rather than blocking execution — no error reaches the end user.
  • Confirmation-dialog variables Since 1.8 are allowed only when actionTypes is exactly [SingleEntry] (enforced by validation).
  • Field-value mapping. Pre-fill values live in relevantAction.fieldsMapping. The designer’s value types map to FieldValueTypeEnum: Field = Dynamic (a source path on the current entry), Manual, Not Set (null), Pointer (evaluates a context token such as @me and injects the resolved value with its display title) and Expression (stored JavaScript). The same mapping can also be turned into a filter: a multi-value context token such as My Groups builds an In condition, so a button can both pre-fill a form and scope which entries it targets. When relevantAction.overrideFieldsMappingLockedFields is set, the mapped field names are treated as locked; getSystemButtonOverridableLockedFields(id) returns those names (else []) so the override UI can lock them.
  • Availability filter. A button may carry a saved query (query) and an inline filter (criteria); when both are present they are merged with AND. Saved queries are offered under the designer’s entries-source picker. Behaviour on non-matching entries is nonMatchEntriesMode: Disable (default) or Hidden. The per-entry evaluation is described under Availability: status for entries.
  • Script buttons Since 1.8 store their body in relevantAction.customScript. The client calls it with a context argument exposing entity, view, entry, entries and popupManager; for a multi-entry button context.entries holds every selected row.

Extends DataEntry; its constructor pins dataEntity = 'SYSTEM_BUTTON'. The button-specific payload lives entirely under value (SystemButtonDataEntryValue).

FieldTypeRequiredNotes
nameLocalizedValueyesButton label. Validated to be localized and unique per related entity.
normalizedNamestringnoAuto-generated programmatic identifier derived from name, unique per related DataEntity.
descriptionNullableLocalizedValuenoOptional description.
iconIconyesButton icon.
relatedToDataEntityReferencePropertyyesThe entity the button acts on. relatedTo.dataEntry is the entity id.
relevantActionSystemButtonRelevantActionyesWhat the button does (event / redirect / script).
actionTypesButtonActionTypeEnum[]yesWhich selection scopes the button supports (single / collection / multiple).
isPublishedbooleanno (default false)Only published buttons are returned by the “active” endpoints and are executable.
queryReferenceProperty | nullnoReference to a stored data query whose criteria gate button availability.
criteriaFilterExpressionnoInline filter expression that gates button availability. Merged (AND) with query.criteria when both present.
nonMatchEntriesModeSystemButtonNonMatchEntriesModenoBehaviour when selected entries don’t match the criteria: disable vs. hide.
confirmationDialogSystemButtonConfirmationDialognoOptional confirmation dialog shown before execution.
FieldTypeNotes
typeRelevantActionTypeEnumCustomEvent = 0, Redirect = 1, Script = 2.
triggerIdstringFor CustomEvent: the reaction/trigger id resolved against the reaction-service.
redirectionSystemButtonRedirectionPrimary redirection target.
successRedirectionSystemButtonRedirectionRedirect on success.
failureRedirectionSystemButtonRedirectionRedirect on failure.
fieldsMappingEntryActionOptionsValue[]Field overrides passed to the action.
overrideFieldsMappingLockedFieldsbooleanWhen set, the mapped field names are treated as locked.
customScriptstringScript body for Script-type buttons. Since 1.8
FieldTypeNotes
typeButtonRedirectionTypeEnumRelatedEntries = 0, SameView = 1, Url = 2.
relationIdstringRelation to navigate through (for relation-based redirects).
relationRedirectionTargetButtonRelationRedirectionTargetEnumEntriesList = 0, ShowEntryDetails = 1, CreateEntry = 2, UpdateEntry = 3.
urlstringTarget URL for Url redirects.
urlTokensMap{ [key]: TokenSource }Token bindings interpolated into url at read time when an entryId is supplied (keys use the str- prefix pattern).

Since 1.8

Shown before the button executes.

FieldTypeNotes
enabledboolean (default false)Master switch.
titleNullableLocalizedValueDialog title (supports token placeholders).
contentNullableLocalizedValueLong-form body text (supports token placeholders).
proceedButtonLabelNullableLocalizedValueConfirm-button label.
cancelButtonLabelNullableLocalizedValueCancel-button label.
variablesSystemButtonDialogVariable[]Token bindings used to interpolate title/content. Only allowed when actionTypes is exactly [SingleEntry].

SystemButtonDialogVariable: { name: string, valueType: TokenSourceType, value: any }. TokenSourceType is Fixed = 0, Field = 1, Expression = 2, Pointer = 3.

Recorded per target entry after a CustomEvent button executes (via DataEntryHistoryService.createHistoryForButtonClicked, historyType = ButtonClickedHistory). Stores buttonId and the localized buttonName.

RelevantActionTypeEnum CustomEvent = 0, Redirect = 1, Script = 2
ButtonActionTypeEnum SingleEntry = 0, DataCollection = 1, MultipleEntries = 2
SystemButtonNonMatchEntriesMode Disable = 0, Hidden = 1
ButtonRedirectionTypeEnum RelatedEntries = 0, SameView = 1, Url = 2
ButtonRelationRedirectionTargetEnum EntriesList = 0, ShowEntryDetails = 1, CreateEntry = 2, UpdateEntry = 3
EventExecutorTypeEnum SYSTEM, MANAGER, EXECUTOR // EXECUTOR = the user who initiated the action
AskUserForEntityTypeEnum InlineEntity = 0, View = 1
TokenSourceType Fixed = 0, Field = 1, Expression = 2, Pointer = 3

Enum values are numeric (persisted as numbers) except EventExecutorTypeEnum, which is a string enum. Verified in packages/osos-shared/src/models/enums.ts.

There is no POST /v1/system-buttons create endpoint. Buttons are managed through the generic data-entry CRUD, using the system_button entity:

OperationRoute (from data-entries.controller.ts)
CreatePOST /v1/entities/{entity}/entries
UpdatePATCH /v1/entities/{entity}/entries/{id} (v1) / PATCH /v2/entities/{entity}/entries/{id}
DeleteDELETE /v1/entities/{entity}/entries/{id}

Here {entity} resolves to the SYSTEM_BUTTON / system_button entity. The request body is a DataEntry whose value is a SystemButtonDataEntryValue as described above.

SystemButtonValidator runs on the CREATE and UPDATE phases for the system_button entity. It enforces:

  1. value.relatedTo.dataEntry must be present, and the related entity must exist. If the related entity is implicit and not implicitOptions.allowEdit, an ImplicitEntityUpdateException is thrown.
  2. Confirmation-dialog variables are single-entry-only. If confirmationDialog.variables are present, actionTypes must be exactly [SingleEntry]; otherwise ConfirmationDialogVariablesNotAllowedForMultiScopeException (SYSTEM_BUTTON_CONFIRMATION_DIALOG_VARIABLES_NOT_ALLOWED_FOR_MULTI_SCOPE).
  3. For CustomEvent buttons with a triggerId, the trigger is resolved against the reaction-service. A missing trigger throws TriggerNotExistException; a trigger that is invalid (validations.isValid === false) or disabled throws InvalidOrDisabledTriggerException.
  4. Name uniqueness: value.name must be localized (LanguagesService.validateName) and unique per related entity — a match on any language value against another button of the same relatedTo.dataEntry throws UniqueValueException.

All SystemButtonController routes require Auth2 authentication and pass through the entity voter. Reads are scoped to the space’s readable stores (StoreService.getStoresForRead) and to state = Active, isInvalid = false.

Method & PathPurpose
GET /v1/system-buttonsAll active buttons in the space, enriched per button via the reaction-service (SystemButtonDataEntryDto[]). N+1 across a service boundary — slow for large spaces.
GET /v1/system-buttons/rawAll active buttons as raw stored entries (SystemButtonDataEntry[]), no reaction enrichment; disabled-trigger buttons are not dropped. Intended for internal consumers (e.g. packaging import conflict detection). Since 1.8
GET /v1/system-buttons/countCount of active buttons (Where filter supported).
GET /v1/system-buttons/by-id/{id}Single active, valid button by id (raw entry). 404 SystemButtonNotFound if not found.
GET /v1/system-buttons/{relatedToId}Buttons for a related entity (enriched DTOs).
GET /v1/system-buttons/{relatedToId}/active?entryId=Active (published) buttons a user can see for a related entity. Optional entryId resolves redirection-URL tokens and confirmation-dialog variables against that record.
POST /v1/system-buttons/{relatedToId}/status/entriesPer-button enabled/hidden status across a set of entries (see Availability).
GET /v1/system-buttons/{id}/optionsReaction actions for a CustomEvent button (DataReactionAction[]).
GET /v2/system-buttons/{id}/optionsv2 options: actions plus ask-user entity/view/dialog metadata (SystemButtonOptionsDto).
POST /v1/system-buttons/{id}Execute the button (see Execution).

getAllActiveSystemButtonsDto / getSystemButtonsByRelatedToDto fetch the bound reaction from the reaction-service and fold trigger metadata into relevantAction as a SystemButtonRelevantActionDto: triggerName, uiEvent, askUser, isTriggerDisabled, executionIndicator, messages, and executorType (defaulting to EventExecutorTypeEnum.EXECUTOR when the trigger has no explicit executor). In the “active” DTO listings, buttons whose bound trigger is disabled are skipped; the raw endpoint keeps them.

uiEvent is derived, not stored Since 1.8 — the DTO still tells the client whether the bound trigger has a user interface, but the trigger no longer carries a separate uiEvent flag. Both DTO builders now compute the field from the trigger’s custom action type: uiEvent is true exactly when the custom action type is UI. The wire shape is unchanged — still a plain boolean — so existing button consumers are unaffected; only the source of the value moved.

askUser is a second, independent flag Since 1.8. Because a button can now only ever be bound to a UI-level custom action (see System buttons can only fire UI-level actions below), uiEvent is true for every button — it can no longer tell a client whether clicking the button should open the “ask user” dialog first. SystemButtonRelevantActionDto therefore exposes a second boolean, askUser, computed as true exactly when the bound trigger’s eventConfig.askUser.enabled is set. Clients must gate the ask-user dialog on askUser, not uiEvent — a button bound to a UI action with no ask-user configuration now executes immediately, with no empty dialog popping up first.

When entryId is provided to getSystemButtonsByRelatedToDto, the service also:

  • resolves relevantAction.redirection.urlTokensMap against the record and interpolates them into redirection.url, and
  • resolves confirmationDialog.variables into token values and interpolates them into the dialog title/content (per language).

Both resolutions are best-effort: failures are logged as warnings and the button is still returned with unresolved text.

Ask-user options (GET /v2/system-buttons/{id}/options)

Section titled “Ask-user options (GET /v2/system-buttons/{id}/options)”

For a CustomEvent button whose reaction has eventConfig.askUser.enabled, this returns the ask-user surface the UI must render:

  • mode = InlineEntity → returns the reaction’s inline entity as askUserEntity.
  • mode = View → loads the configured entity + view and returns a projected entity via getEntityBasedOnAskUserViewConfigurations, which keeps only the fields listed under the view’s AllowAskUserFor supported operation, renames the entity to askUser, and re-ids it as TRASK_{entityId}_{triggerId}.

If the trigger is missing/invalid/disabled the same TriggerNotExistException / InvalidOrDisabledTriggerException errors apply.

Fields inside a shared block are kept Since 1.8 — the view’s AllowAskUserFor allow-list holds fullNormalizedNames such as cc.email or attachment. A top-level field is kept when its normalizedName matches an allowed entry; a sub-field of an internal entity (a block) is kept when any of its block-qualified names is allowed. That “any” rule is what makes shared blocks work: when one block definition backs several top-level block fields — To / CC / BCC recipient blocks, say — the projected entity emits that block’s sub-fields once per prefix (to.email, cc.email, bcc.email, …), all carrying the same sub-field id. A view that exposes only cc.* and bcc.* still keeps those shared sub-fields, because the match is tested against every block-qualified occurrence of the id rather than only the first one encountered. So you can now ask the user for a sub-field that lives inside a shared block.

POST /v1/system-buttons/{relatedToId}/status/entries answers “for these selected records, is each button enabled or hidden?”.

Request body (GetSystemButtonsStatusForEntriesRequestDtoModel):

{
"dataEntriesIds": ["<entryId>", "..."],
"selectAll": { "enabled": true, "...": "SelectAllDto criteria" }
}

You must supply either dataEntriesIds or selectAll.enabled = true; otherwise GetSystemButtonsStatusForEntriesMustProvideIdsOrSelectAllException (GET_SYSTEM_BUTTONS_STATUS_FOR_ENTRIES_MUST_PROVIDE_IDS_OR_SELECT_ALL). With selectAll, the entry ids are resolved from the query engine (getEntriesIdsBySelectAllDto).

Response is SystemButtonStatusForEntriesResponseDtoModel[]: { systemButtonId, isDisabled, isHidden }.

Logic (getSystemButtonsStatusForEntries + generateGetButtonsStatusForEntriesAggregationStages):

  • Buttons with no query and no criteria are always isDisabled: false.
  • For buttons with a filter, a MongoDB aggregation runs a $facet — one branch per button — that counts how many of the selected entries match the button’s criteria (query.criteria merged with inline criteria via AND). A button is enabled only if every selected entry matches (matchingEntriesCount === dataEntriesIds.length); otherwise it is disabled.
  • When no selected entry matches at all, the non-match behaviour depends on nonMatchEntriesMode: default (Disable) → { isDisabled: true, isHidden: false }; Hidden → { isDisabled: true, isHidden: true }.
  • System fields such as @current_user / @myGroups in the criteria are resolved via getSystemFieldsStages before the facet.

POST /v1/system-buttons/{id} with an ExecuteSystemButtonDto body:

FieldTypeNotes
modeButtonActionTypeEnumSelection scope of this execution.
sourcestring | string[]Single entry id, data-collection id, or an array of entry ids — depending on mode.
askUserValueIEntryValueThe ask-user payload collected from the dialog, forwarded to the reaction.
selectAllSelectAllDtoFor MultipleEntries with select-all: resolves the full id set server-side.

Execution flow (only meaningful for RelevantActionTypeEnum.CustomEvent; Redirect/Script buttons are resolved client-side and do not go through this handler):

  1. View guard — if the request is scoped to a DataViews, the button must be listed in view.systemButtons, else SystemButtonNotFound.
  2. Load button — must be state = Active, isInvalid = false, and value.isPublished = true, else SystemButtonNotFound.
  3. Resolve target entries from mode + source:
    • SingleEntry → one ReferenceProperty for source.
    • DataCollection → the collection’s items (the collection must belong to the button’s related entity, else DataCollectionNotFoundException).
    • MultipleEntries → the id array; if selectAll.enabled, ids are expanded via getEntriesIdsBySelectAllDto.
    • Missing source → MissingPropertyException.
  4. Re-check availability for the resolved entries; if the button is disabled for that set, SystemButtonIsDisabled (SYSTEM_BUTTON_IS_DISABLED, 403).
  5. UI-level guard Since 1.8 — if relevantAction.triggerId is set, the bound trigger’s custom action type is checked; a Local or External binding is rejected with SystemButtonNotUiCustomAction (403). See System buttons can only fire UI-level actions below.
  6. Emit feedback + publish event — a JobScheduledMessage is emitted over the socket immediately for UI feedback, then a CustomEventTriggeredEvent (entity id, target entries, user id, triggerId, timestamp, askUserValue) is published on the service bus, carrying messageId, instanceId, correlationId (trace id) and sticky attributes (userId, delegateeId, delegationId, spaceId). The reaction-service handler picks this up.
  7. History — createHistoryForButtonClicked records a ButtonClickedHistory entry per target.

The endpoint returns the generated messageId (a UUID) so the client can correlate the async execution result.

System buttons can only fire UI-level actions Since 1.8

Section titled “System buttons can only fire UI-level actions Since 1.8”

A button’s relevantAction.triggerId can, structurally, point at any CustomEvent reaction — nothing stops it from naming a Local- or External-level custom action, which are meant to be invoked only by another reaction’s Execute Custom Action action, not by a button click. Step 5 of the execution flow above closes that gap: it loads the bound trigger’s custom action type before publishing the execution event, and rejects the click with SystemButtonNotUiCustomAction (403, “this button is bound to a custom action that is not a UI action”) when it is Local or External.

This is a backstop, not the primary defence — the button editor lists only UI-level custom actions in its Action picker, so a non-UI trigger cannot be chosen there. The runtime check exists for buttons saved before that editor restriction shipped, and for direct API writes that bypass the editor. A button whose trigger can’t be loaded at all (a transient lookup failure, or no triggerId set) is not rejected by this check — it only blocks an explicitly non-UI level, not “anything uncertain.”

The reverse direction — an Execute Custom Action action can never target a UI-level custom action — is enforced when the reaction is saved; see Execute Custom Action.

POST /v1/system-buttons/{buttonId}
Content-Type: application/json
{
"mode": 0,
"source": "8f3c...entryId"
}

For a multi-entry execution with select-all:

{
"mode": 2,
"selectAll": { "enabled": true }
}

GET /v1/system-buttons/{relatedToId}/active in preview mode returns the entity’s real buttons (real name/icon/config) but with fake ids (FakeEntryGeneratorService.withFakeIds) so none can be executed against a fake entry; entryId is intentionally not forwarded to the real query in preview mode. If the current view has an empty systemButtons list, the endpoint returns [].

  • Store/space scoping is applied in buildActiveSystemButtonsWhere and in getSystemButtonsByRelatedToDto: buttons are filtered by store.dataEntry ∈ readableStores, state = Active, isInvalid = false, and (for active listings) value.isPublished = true.
  • N+1 caution: the enriched DTO listings call the reaction-service once per button. getAllActiveSystemButtonsRaw / GET /v1/system-buttons/raw exists specifically to avoid this for consumers that only need stored data.
  • getSystemButtonOverridableLockedFields(id) returns the mapped field names when relevantAction.overrideFieldsMappingLockedFields is set (else []) — used to lock the mapped fields in the override UI.
  • The ExecuteSystemActionOverrideValuesDto ({ actionId, options }) and the commented-out getTriggerToExecuteForSystemButton / validateSystemButtonTrigger in the service indicate an older action-override path that is currently inactive; override handling now lives in the reaction-service. Do not rely on those commented blocks.
FeatureMilestone
Custom script action (relevantAction.customScript)Since 1.8
Confirmation dialog (confirmationDialog, dialog variables)Since 1.8
Custom-link / confirmation-dialog tokensSince 1.8
Raw listing endpoint (GET /v1/system-buttons/raw)Since 1.8
uiEvent derived from the trigger’s custom action type (replaces the stored flag)Since 1.8
askUser on the button’s relevant-action DTO (the ask-user dialog gate, independent of uiEvent)Since 1.8
System buttons rejected at execution when bound to a Local/External custom action (SystemButtonNotUiCustomAction, 403)Since 1.8
normalizedName on buttonsSince 1.6

Non-match-entries mode (nonMatchEntriesMode) and the v2 options endpoint predate the 1.2 milestone, so they carry no availability badge (treat as Long-standing).

Platform 1.10.0 · Backend 1.11.0-alpha.11 · Frontend 1.11.0-alpha.6 · Mobile 1.10.2 · Chart 1.11.8 · Gateway 2.6.11 · MCP 0.2.0 · Grafana DS 1.2.0Docs build 2026-11-27