Skip to content
Verified

Globals in Studio

The Fields and Events tabs behind Globals, the one shared program every project has exactly one of.

Globals is the one program every project has exactly one of: shared values and shared behavior that any Component, Get Data, Set Data, Batch, JavaScript or API program can read. For the underlying schema, progFields, progEvents, and the .xu and JSON shape, see Globals (building block). This page covers the two tabs in its Studio screen.

Fields tab

Global fields are named shared values, such as app_theme, discount_rate or support_email.

Events tab

Global events are shared workflows: behavior that should be reachable from more than one place, not tied to a single screen.

Client interval and Server cron don't work on Globals yet

Studio's Global event type menu lists five choices, but the runtime checker only accepts three of them on a Globals program: On load, On exit and User defined. Choosing Client interval or Server cron passes Studio's own dropdown and then fails project validation. If a project needs recurring polling today, put a Client interval event on a Component instead, where it's actually supported.

Keep Globals for values and behavior genuinely shared across the app: a signed-in user setting, a feature flag, an active campus. Keep screen-only state on the component that owns it, and use a User defined event when a behavior should be callable from more than one place.