Skip to main content

Static Array

Static Array: inline JSON or CSV authored in the editor, emitted as an array of objects.

Static Array turns literal data typed into the node — JSON (an array of objects) or CSV with a header row — into an items array plus a count. Each element becomes a client-side object, so downstream nodes treat the items exactly like query results or shared-array elements.

When to use it

Fixtures, menus, option lists, demo content — any list that ships with the app rather than coming from a backend or user input. For runtime-mutable lists feed an Array (Collection2); for remote data use Query Records or REST.

At a glance

CategoryData
Type nameStatic Data
Available inbrowser, cloud
SSR compatibilitysafe
Provided bynoodl-runtime

Inputs

Values

NameTypeDefaultDescription
csvStringRows of comma-separated values whose first row names the properties; every cell is read as a string, so use JSON if numbers must stay numbers — ignored unless Type is CSV
jsonStringAn array of objects authored inline; unlike CSV it keeps numbers and booleans as they are — ignored unless Type is JSON
typeEnum (csv, json)csvWhich of the two authoring formats below is read

Outputs

Values

NameTypeDefaultDescription
countNumberHow many rows the last successful parse produced
itemsArrayThe authored rows, as an array of records; unchanged while the JSON cannot be parsed

Failure outputs

NameTypeDefaultDescription
errorStringWhy the JSON could not be parsed, in one sentence; empty until a parse fails
failureSignalFires when the authored JSON could not be parsed, leaving Items as it was

Dynamic ports

This node's port list changes at runtime (declared-port-groups); the tables above may be incomplete for a given instance.

Output ports are derived from the columns/fields of the data entered in the "data" parameter.

ConditionInputs shownOutputs shown
type = csv OR type NOT SETcsv
type = jsonjson

Ports at runtime

Declared-port-groups only: the json and csv text inputs swap in based on type. No ports depend on the data itself.

Patterns

  • Static Array → Array Filter/Array Map → Repeater: fixture-driven UI with real list plumbing.

Watch out for

  • Editing Static Array content from logic at runtime — it is authoring-time data; use an Array for mutable lists.

Examples

Named shared array with insert, remove and clear

A client-side list without a backend: an Array node (Collection2) binds to the named shared array 'todos' and feeds a Repeater. Add Item (CollectionInsert), Remove Item (CollectionRemove) and Clear (CollectionClear) mutate the same array by its collectionId; every node bound to that id — including the Array feeding the list — sees the change immediately. Ids on wires tie the writers to the store.

Static array filtered and mapped into a list

Local data without a backend: Static Array holds inline JSON, Array Filter narrows it with a per-item filter script, Array Map reshapes each element with a map script, and the result drives a Repeater. Filter and Map are non-destructive — they emit new arrays and leave the source untouched, so several differently-filtered views can share one source.

Repeater item writes back to its own record object

Inside a Repeater item component, Repeater Item (For Each Actions) exposes itemId — the id of this row's object. Wiring it into Set Object Properties (SetModelProperties) modelId makes the write target exactly this row: toggling the checkbox stores done on the row's object, and every other node bound to that object updates. The row never needs to know which list it belongs to.

Array, Array Filter, Array Map, Repeater

Generated

This page is generated from node-catalog-enriched.json. Do not edit it by hand — run npm run docs:nodes to regenerate, and fix the source enrichment instead.