Skip to content

Expressions

Expressions are small runtime code snippets that use standard JavaScript and TypeScript syntax to calculate values, control behavior, and interact with application data throughout Lowgile.

These expressions typically return a value that the application uses at runtime. They are commonly used to:

  • Calculate values,
  • Configure dynamic labels,
  • Control visibility and behavior,
  • Read and update runtime values, and
  • Configure workflow and screen logic.

Expressions are used throughout the platform, including:

  • Screen bindings,
  • Component labels and values,
  • Visibility conditions,
  • Workflow logic,
  • Static entity expressions,
  • Dynamic dropdown values,
  • Computed values,
  • Services and integrations, and
  • AI-assisted extraction logic.

Expressions execute within a runtime context that determines which objects and values are available.

Common expression contexts include:

ContextPurpose
screenAccesses screen variables and screen state.
item / itemIndexAccesses the current loop item and loop index inside ForBlock components.
ThisAccesses application modules, entities, services, workflows, and static entities.
SysAccesses Lowgile platform services and runtime functionality.

The following examples demonstrate common ways expressions are used throughout Lowgile to read runtime values, calculate results, control behavior, and generate dynamic content.

Expressions commonly read values from runtime objects, variables, entities, workflows, screens, and platform objects.

For example:

screen.request.costCenter

This expression accesses the costCenter property from the request screen variable.

Expressions can generate display values at runtime.

For example:

`${item.description} - ${item.quantity}`

This expression combines multiple properties from the current item loop variable into a single display value.

Expressions are frequently used to control visibility and runtime behavior.

For example:

screen.request.status === 'Approved'

This expression returns a boolean value that can be used to show or hide components dynamically.

Expressions can also calculate values at runtime.

For example:

screen.quantity * screen.unitPrice

This expression calculates a total value using two variables dynamically.

Expressions and scripts serve different purposes.

Expressions are usually small inline statements that return a value.

For example:

screen.request.status === 'Approved'

This expression evaluates whether the request status is Approved and returns either true or false.

Scripts are typically larger procedural blocks used to execute actions or runtime logic.

For example:

async function optionsList(): Promise<This.Materials.Entry[]> {
const xls = await Sys.Xls.SimpleXls.fromFile('list-materials.xlsx', 'xlsx')
return xls.parseToObjects({ sheetNameOrNumber: 'Materials' })
}

The Lowgile console executes expressions within its own runtime context. Some runtime variables, such as item or itemIndex, are only available inside the components that provide them.