logologo
Get Started
Guide
Development
Plugins
API
Home
English
简体中文
日本語
한국어
Español
Português
Deutsch
Français
Русский
Italiano
Türkçe
Українська
Tiếng Việt
Bahasa Indonesia
ไทย
Polski
Nederlands
Čeština
العربية
עברית
हिन्दी
Svenska
Get Started
Guide
Development
Plugins
API
Home
logologo
RunJS Overview
Import Modules
Render in Container

Globals

window
document
navigator

ctx

ctx.blockModel
ctx.collection
ctx.collectionField
ctx.dataSource
ctx.dataSourceManager
ctx.element
ctx.exit()
ctx.exitAll()
ctx.filterManager
ctx.form
ctx.getModel()
ctx.getValue()
ctx.getVar()
ctx.i18n
ctx.importAsync()
ctx.initResource()
ctx.libs
ctx.location
ctx.logger
ctx.makeResource()
ctx.message
ctx.modal
ctx.model
ctx.notification
ctx.off()
ctx.on()
ctx.openView()
ctx.render()
ctx.request()
ctx.requireAsync()
ctx.resource
ctx.route
ctx.router
ctx.setValue()
ctx.sql
ctx.t()
ctx.view
Previous Pagectx.getValue()
Next Pagectx.i18n

#ctx.getVar()

Read a variable value from the current runtime context. Variable resolution is consistent with SQL and template variables and usually comes from the current user, current record, view params, etc.

#Type definition (simplified)

getVar<T = any>(path: string, defaultValue?: T): T | undefined;
  • path: variable path, supports dot access (e.g. user.id) or full expression (e.g. ctx.user.id); in FlowEngine it maps to the corresponding context object
  • defaultValue: optional default if the variable does not exist or is undefined

Notes:

  • ctx.getVar() uses the same resolution rules as {{ctx.xxx}} in SQL/template variables
  • Common variables include ctx.user.*, ctx.record.*, flow input params, view/modal params, etc.