Skip to main content

Static Array

This node defines a fixed list of data using CSV or JSON.

The Static Array node (also known as Static Data) allows you to hardcode a dataset into your graph.

The Static Array node is the easiest way to create a constant list of items. You can enter data as CSV (Comma Separated Values) for simple tables or JSON for complex objects. It outputs an array that can be used immediately by other nodes.

Inputs

General

DataDescription
TypeSelect the format: "CSV" or "JSON".
CSVText area for CSV data (if Type is CSV). First row is headers.
JSONText area for JSON data (if Type is JSON). Must be a valid JSON array [...].

Outputs

General

DataDescription
ItemsThe parsed array of objects.
CountThe number of items in the array.

Usage

Use this for dropdown options, mock data, configuration lists, or any data that doesn't change.

Example Use Cases

  1. Dropdown Options:
    • Type: CSV
    • Content:
      label,value
      Small,s
      Medium,m
      Large,l
  2. Mock Data: Testing a UI before the API is ready.
    • Type: JSON
    • Content: [{"name": "Test User", "id": 1}, {"name": "Admin", "id": 2}]

Detailed Behavior

  1. Parsing: Data is parsed immediately when entered or when the node loads.
  2. CSV Parsing: The first line is treated as property keys. Subsequent lines are values.
  3. JSON Parsing: Must be a valid JSON array. Syntax errors will trigger warnings.

Troubleshooting

  • JSON Error: Ensure you use double quotes " for keys and strings in JSON. Single quotes ' are not valid JSON.
  • CSV Issues: Ensure you have a header row. a,b,c on line 1 means objects will have keys a, b, and c.