Variables are the memory of your app. Choosing the right type keeps your app fast and your formulas readable.
Global variables with Set()
Set(varUser, User()) stores a value that every screen can read. Use it for user details, settings and app-wide flags.
Context variables with UpdateContext()
UpdateContext({locShowPopup: true}) is scoped to a single screen, which makes it perfect for pop-ups and toggles.
Collections with ClearCollect()
Collections hold tables in memory. Use them for offline caching or for staging data before you Patch it back to the source.
Quick rule of thumb
- One screen only → UpdateContext
- Many screens → Set
- A table of records → Collect / ClearCollect