Skip to content

This pattern is for builders who notice they are building the same thing twice — the same filter, the same approval stage, the same three automation steps. Read it after My First Application. By the end you will know what OSOS lets you build once and reuse, and what you must repeat — and keep small.

Copied logic drifts. A filter for “open requests” pasted into four views, a two-step budget approval rebuilt in three workflows, the same “notify, update, log” sequence repeated on every entity — each copy is changed separately, and sooner or later one is forgotten. The application then behaves differently depending on which screen someone used.

Reach for reuse whenever the same rule appears twice:

You are repeating…Build it once as…
A filter (“my records”, “open”, “overdue”)A saved query, used by views, reference fields, summaries, reports and reaction filters
“The current user”, “my unit”, “today”A pointer — @me, @myOrgUnit, @today, @StartOfMonth
A stage of a process (a budget approval)A sub-workflow on the same entity
A sequence of automation stepsA Custom Action, called from buttons or from other reactions
“Something happened; others may care”An Announce Event, picked up by On Event Announced reactions on any entity
A validation used on many fields or entitiesA Value Validator or Standalone Validator (a function — deep code)
A set of optionsA shared list
  1. On the entity’s Queries tab, build the condition once — for example Created by = @me — and save it as My records.
  2. Use it as the Query of each view that needs it, as the source of a Reference field, and as the Saved Query in a reaction’s Filter. See Use a saved query elsewhere.

Change the query, and every place that uses it follows.

  1. On the entity’s Workflows tab, create the shared stage as its own workflow, with its own initial and final steps.
  2. In each main workflow, add a step with Step Type Sub-Workflow Step, choose the shared workflow in Target Workflow and the Merge Step where the main workflow continues.

A sub-workflow is reused within one entity. See Reuse a process: sub-workflows.

  1. On the entity’s Reactions tab, add a reaction with the event Custom Action, and choose its Custom action level:
    • UI action — run by a button;
    • Local action — called by other reactions in the same module;
    • External action — called by reactions in any module.
  2. Give it its single action, and chain the rest of the sequence to it with Reaction Succeeded — see chain reactions.
  3. Call a Local or External action from any reaction with Execute Custom Action Since 1.8.
  1. Where something happens, add a reaction with Action Type Announce Event Since 1.8 and a clear name.
  2. Wherever something should follow, add a reaction with the event On Event Announced, on any entity.

The announcer does not need to know who listens, so new listeners can be added later without touching it.

For calculated values and validations, which live on one field:

  • Keep each expression short; split a long one across helper fields.
  • Write what it does in the field’s description, so the next builder can find and change every copy.
  • When the same rule truly applies in many places, ask whether it should be a Value Validator — written once by your developers, then picked with Select Value Validators on each field.

Worked example: a one-click button in Customer Support

Section titled “Worked example: a one-click button in Customer Support”

An extension of the Customer Support tutorial, for design practice. The support desk wants a Mark as duplicate button on a ticket. Built by hand, the desk would set Ticket status to Duplicate, close the ticket, and tell the customer — three separate things, each easy to forget.

Built once:

  1. A reaction Mark as duplicate, event Custom Action, Custom action level UI action, action Update Data Entry (Self): Ticket status = Duplicate.
  2. A reaction with event Reaction Succeeded after Mark as duplicate, action Execute Workflow Step Action: the Close Ticket action at Help Desk.
  3. A reaction with event Reaction Succeeded after the first, action Send Notification to the customer.
  4. On the Buttons tab, a button whose Action is the Mark as duplicate custom action, shown in the Incoming Requests view.

Every duplicate is now handled the same way, and changing the message is one edit.

A calculated field kept short: the tutorial’s Support Tickets has no totals, but the classic case is an Estimated cost field — a locked Number with the Advanced default value value.unitPrice * value.quantity, triggered On field change. One line, described in the field’s description, is easy to repeat safely; a twenty-line expression copied into six fields is not. See Give a field a starting value.

  • The same long expression pasted into six fields. One copy gets fixed, five do not. Keep it short, split it, or ask for a validator.
  • A function where a field setting would do. Code is harder to change and test than a designer option. The ACE — Certified Expert course teaches the same rule: no requirement should be deep code when a designer option does the job.
  • Rebuilding an approval stage in every workflow. Make it a sub-workflow.
  • One reaction per view doing the same job. Reactions belong to the entity, not to a screen; one reaction serves every view.
  • Copying a filter into each view. Save it as a query and select it.

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