SmartApps Actions and expressions

Actions: a trigger, an execution and an outcome, written once and tested as you type.

Every component can carry several actions. An action has a trigger, the condition that fires it; an execution, the thing it does; and an outcome, what changes on the screen, in the data or in the flow.

COMPONENT ACTION · GRD_CLAIMSTRIGGERa condition on the componentrow selected and status == 'in warranty'ACTIONthe executioncall dh_claims.read(claim_id) · runfunction check_coverage()OUTCOMEwhat changesfill pnl_detail · enable btn_approve ·set app.claim_totalExpression editor= if(dh_claims.expires >= sys.today, 'in warranty', 'expired') ▸ test with claim CLM-2041 → 'in warranty' ✓
One action on a grid: when a row with a covered claim is selected, read the claim and run a coverage function, then fill the detail panel, enable the approve button and set an app variable. The editor line beneath shows a test against a real claim.
3
parts of an action: trigger, execution, outcome
product
6
kinds of execution: set a value, call a data handler, run a function, run a script, call a REST endpoint, start or move a flow
product
4
variable scopes: screen, app, global, system
product
1
formula language for criteria, calculations, validations and actions
product
0
saves needed to see a result: the editor evaluates as you type
product
Triggers

What fires an action

A trigger is a condition on the component or on the screen: a button clicked, a value entered and valid, a row selected, a dropdown changed, a screen loaded, a file uploaded, a barcode scanned, a clock reached. Triggers can carry a criterion, so a grid's row-selected trigger fires only for rows in a certain status, and a field's value-changed trigger fires only when the new value is outside a range.

Triggers keep the screen honest: an approve button that enables only when the note has ten characters and the claim is covered is two triggers with two outcomes, and the person sees the button light up as the conditions are met.

TriggerFires whenExample criterion
on clicka button or link is pressedtxt_note.value.length > 10
on changea field, dropdown or checkbox changesdd_decision.value == 'split'
on valida field passes its validationtxt_serial matches the serial pattern
on selecta grid row or list item is selectedgrd_claims.selected.status == 'in warranty'
on loadthe screen opens for a rolesys.role == 'assessor'
on upload / scan / signa file, code or signature is capturedup_photos.count >= 1
on clocka step's clock reaches a pointclock.remaining < 1h
Executions

What an action does

Written in the editor; scripts and REST calls where a formula is too small.

ExecutionDoesExample
Set a valueWrites a property of a component or a variableapp.claim_total = grd_claims.selected.estimate
Call a data handlerReads, updates, saves or deletes rows through a handlerdh_po.update(line, confirmed_date = dt_new.value)
Run a functionCalls a named function of the platform or one you registeredcheck_coverage(serial, fault_date)
Run a scriptExecutes a script for logic beyond a formulapython: allocate(open_orders, stock)
Call a REST endpointCalls an external service and maps the answerscreening(legal_entity) → risk_class
Move the flowStarts an instance, completes the step, starts a clock, notifiescomplete_step('decide'); notify(role.buyer_lead)

Executions run with the identity of the person acting and the app's own grants, so a handler write goes through the source's released interface under the same access rules as any other write. Long executions, such as a script over many rows, run in the background and the outcome fires when they return; the screen shows the state meanwhile.

Every execution is logged with its inputs and its result, so the decision log can show that btn_approve called the ERP change interface with these values and received this document number.

Outcomes

What changes afterwards

An outcome is the visible result: a panel fills, a component enables or hides, a grid refreshes, a value is saved, a row is written back, a notification goes out, a clock starts, the flow moves to the next node. An action can have several outcomes, and outcomes can trigger other components' actions, which is how a screen stays consistent: select a row, and the detail, the chart and the buttons all follow.

Outcomes are also where the platform enforces its own rules. A write-back outcome waits for the acknowledgement before it reports success; a flow outcome checks the arrow's criterion before it moves; an outcome that would violate a validation rule reports the message and stops.

Filla panel, a grid, a chart from a handler or a resultpnl_detail ← dh_claims.row
Enable / showa button, a section, a tabbtn_approve.enabled = true
Savea variable or a draft of the screenapp.decision = 'split'
Write backrows through a handler, acknowledgement storeddh_po.update(...) → ack
Notifya role, a level, a person; card with buttonsnotify(role.supplier)
Movecomplete the step, start a clock, start an instancenext('supplier_reply', clock 8h)
The expression editor

One formula language, tested on live values as you type

Criteria, calculations, validations, triggers and outcomes are all expressions in one language: fields by handler and column, components by ID and property, variables by scope and name, functions by name, with the usual operators, dates, text and lists. The editor completes names as you type and evaluates the expression for a row you pick from the handler, so a threshold, a date rule or a text pattern is checked against a real record before it is saved.

For a start criterion the editor shows the count of rows selected and a sample; for a validation it shows the message the person would see; for an action it runs the trigger and the execution in a sandbox and shows the outcome. A reference to a field the handler lacks, or a type mismatch, is flagged in place.

# trigger criterion of the late purchase order app, tested on live rows
select dh_po_lines where
  delivery_date <= today + 5 and received_qty < qty
→ 31 rows · sample: 4500012345/00010 · EINDT 2026-09-18 · 0 of 1,200 received

# coverage decision on the warranty screen
if dh_warranty.warranty_end >= dt_fault.value
   and dd_fault_type.value in dh_warranty.covered_types
   and num_estimate.value < glob.claim_band
then 'covered' else 'assess'
→ 'covered' for serial CX4-0921 · band 500
Variables

Four scopes, each with a life

System variablesdate, time, logged-in user, user count · always availableGlobal variablesmeaning shared by every app: fiscal calendar, plant list, approval limitsApp variableslive while the app instance runs: claim total, current level, chosen siteScreen variableslive while the screen is open: a filter, a draft value
Screen variables live while the screen is open; app variables while the instance runs; global variables carry business meaning across all apps; system variables give the date, the time, the user and the counts.

Screen variables hold a filter or a draft value and vanish when the screen closes. App variables hold what an instance has decided so far: the claim total, the chosen site, the current level, and they travel from node to node through the variable exchange properties. Global variables are defined once for the platform and carry meaning for every app: the fiscal calendar, the plant list, the approval bands. System variables are provided by the platform: today's date, the time, the logged-in user and role, the number of users online.

Variables have a definition screen with types, defaults and a test, so a global approval band can be checked against a sample amount before any app uses it. Changing a global variable is logged and versioned like any other change.

ScopeLivesDefinedExample
Screenwhile the screen is openon the screenscr.filter_plant
Appwhile the instance runson the appapp.claim_total, app.level
Globalalways; shared by all appson the platformglob.claim_band = 500
Systemalways; providedby the platformsys.today, sys.user, sys.role
Terms on this page

Expression editorThe place where conditions, calculations and actions are written in a short formula language and tested against live values as you type.
VariableA named value with a life: screen variables live while the screen is open, app variables while the app instance runs, global and system variables always.
Data handlerA named connection from an app to rows in a system: a federated table, a saved query, a pipeline result, an API or a file. Screens, expressions and decision points use it to read and write.
ActionA trigger, an execution and an outcome on a component. A component can have several.
Sandbox testRunning a trigger and an execution against a chosen row in the editor, with the outcome shown and every write held.
Questions

Do I need to write code?

Formulas cover almost everything: conditions, calculations, dates, text, lists. Scripts and REST calls are there for the remaining cases, and an application team usually writes those once as functions the business configurators then call by name.

Can an action call our own service?

Yes, through a REST call with the platform's secrets vault holding the credentials; the answer is mapped to variables and the call is logged.

What stops an action from doing damage?

Writes go through data handlers and released interfaces, under the acting person's access rules; a write-back reports success only on acknowledgement; validations stop invalid outcomes; and every execution is logged with its inputs and result.

Can I reuse an action?

Actions on a component travel with the component when it is copied, and a set of actions can be saved as a named function.

See a SmartApp built on your data

Bring one process and the systems it touches. In the first session we register the data handlers, draw the levels or the lanes and run the first screen on your live rows.