Skip to content

Rendering Collections on Screens

When a screen variable contains multiple records, Lowgile exposes the data as an array. Arrays commonly originate from one-to-many entity relationships—for example, a PurchaseRequest that contains multiple PurchaseRequestItems.

Lowgile provides two primary ways to render array-based data in screens:

A Data Table renders array data in a structured, tabular format. This approach is well suited to:

  • viewing or scanning large sets of records
  • displaying structured data in a consistent format
  • working with standard, column-based layouts

Data Tables are optimized for density and consistency rather than custom layout or interaction.

A For Loop renders array data by repeating a layout template once for each item in the array. This approach is better suited to:

  • building custom data-entry interfaces
  • combining multiple components per item
  • supporting complex layouts or conditional UI behavior

When a For Loop is bound to an array, Lowgile exposes a loop-scoped variable (commonly named item) that represents the current record being rendered. Components inside the loop should bind to properties of this loop variable rather than the parent array.

Data Tables and For Loops are not mutually exclusive. A screen may use both approaches when different parts of the user experience require different presentation styles.

Choosing Between Data Tables and For Loops

Section titled “Choosing Between Data Tables and For Loops”

Both approaches operate on the same underlying array. The choice depends on how the data should be presented and interacted with:

  • Use a Data Table when you need a compact, standardized view.
  • Use a For Loop when you need flexibility, custom layout, or rich interaction.

This distinction is especially important in data-entry screens, where For Loops allow you to model complex, repeatable UI structures that align closely with the underlying data model.