Logic, Actions & Events

Updated Jun 19, 2026
DataMagik Application Designer

Logic, Actions & Events

Apps that only display data are useful; apps that act on it are transformative. The Application Designer gives you several ways to add behavior, from no-code configuration to full client logic.

Actions (low-code)

In a layout app, components such as buttons trigger actions: run a script, refresh a source, show or hide a component, navigate to another app, or submit a print job. Chain actions together for multi-step flows — all configured visually.

Running scripts

Scripts run server-side in the V8 sandbox and can fetch, transform, and write data, call Plex data sources, run saved ODBC queries, and reach whitelisted external APIs with managed credentials. Declare a script as a source, then invoke it. In SPA code:

const result = await dm.scripts.run('postReceipt', { poNumber: 'PO-1', quantity: 5 });

You can type a script's inputs and output by augmenting DmScriptTypes — see The App SDK Reference.

Runtime context

Every app receives the context it was opened with — screen-context parameters such as an order or shipper id. These arrive identically on the web, inside Plex, and on mobile, so one app behaves consistently everywhere. In SPA code they are available on dm.context.params; layout apps expose them as runtime values you can bind to.

Output events

Apps can emit output events to tell the host page something happened — for example that a flow completed. In SPA code:

dm.emitOutput('completed', { received: rows.length });

The host (and embedding surfaces like the extension and mobile) can react to these events, enabling apps to participate in larger workflows.

Automations & schedules

Beyond in-app logic, apps sit alongside DataMagik automations, scripts, and scheduled jobs. Trigger an automation from a screen, or let a schedule run work in the background — your application becomes one part of an end-to-end process rather than an island.

Was this page helpful?