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
| Data | Description |
|---|---|
| Type | Select the format: "CSV" or "JSON". |
| CSV | Text area for CSV data (if Type is CSV). First row is headers. |
| JSON | Text area for JSON data (if Type is JSON). Must be a valid JSON array [...]. |
Outputs
General
| Data | Description |
|---|---|
| Items | The parsed array of objects. |
| Count | The 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
- Dropdown Options:
- Type: CSV
- Content:
label,value
Small,s
Medium,m
Large,l
- Mock Data: Testing a UI before the API is ready.
- Type: JSON
- Content:
[{"name": "Test User", "id": 1}, {"name": "Admin", "id": 2}]
Detailed Behavior
- Parsing: Data is parsed immediately when entered or when the node loads.
- CSV Parsing: The first line is treated as property keys. Subsequent lines are values.
- 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,con line 1 means objects will have keysa,b, andc.