Build spreadsheet-powered prompt engines, toggle between All Records and Single Record modes, step through records, and export structured tables.
# Table Node
**Table Nodes** transform Nodestr from a static node graph into a dynamic, data-driven prompt and document generation engine. By embedding structured multi-column, multi-row datasets directly on the canvas, you can cast characters, parameterize test cases, inject full Markdown tables into narrative documents, or export structured spreadsheets.
---
## 1. Table Node Anatomy & Segmented Mode Switch
Every Table Node features a prominent segmented mode toggle below its header: **`[ All Records | Single Record ]`**.
### 1. `All Records` Mode (Default)
- **Segmented Toggle State**: The `All Records` button is highlighted in royal blue.
- **Royal Blue Output Port (`All Records`)**: Located on the right edge, this port bundles all dataset rows into a single combined data stream.
- **Used Schemas List**: The Table Node displays a compact, read-only list showing all defined column schemas (e.g. `Name [TXT] #1`, `Description [TXT] #2`).
- **Downstream Consumer Flexibility**: Downstream Consumer Text Nodes (e.g. Prompt Cards) wired to the Table's `All Records` port feature their own separate header toggle—allowing them to choose between stepping individual records (`📄 Record` mode) or injecting the entire dataset as a formatted table (`📊 Table` mode).
- **1-Click Batch Trigger**: Wiring `All Records` directly to the **Output Hub** compiles the entire table and reveals the **`Run Batch (N rows)`** execution engine.
### 2. `Single Record` Mode (Active Row Stepper & Scalar Ports)
- **Segmented Toggle State**: Switching the button to `Single Record` reveals an interactive stepper directly on the Table Node: `[ < ] Record N of M: Title [ > ]`, allowing you to step through individual rows directly on the canvas.
- **Scalar Column Ports (Sky Blue)**: Unfolds individual output ports for every column schema along the right edge, allowing you to route specific fields (e.g. `Name`, `Description`) to different downstream targets.
- **External Master Control (`Record Selector` / `Index In` Port)**: Connecting an external **Index Node** (or Record Selector) to the Table's left **Violet input port** (`Record Selector`) automatically locks the Table Node into **`🔗 Single Record`** mode with its local stepper set to read-only (`🔗`). All parallel tables advance in perfect unison from a single master control point.
> [!NOTE]
> Distinguish clearly between the **Table Node's mode toggle** (`[ All Records | Single Record ]`) and a **Consumer Text Node's consumption toggle** (`[ 📄 Record | 📊 Table ]`). The Table Node controls whether it outputs the full dataset bundle or individual column scalar handles. The downstream Consumer Text Node controls whether it interpolates records row-by-row or renders the full dataset as a Markdown table.
---
## 2. The Spreadsheet Grid Editor
Double-click any Table Node (or click the **pencil** icon on its header) to launch the full-featured spreadsheet modal:
- **Columns (Schemas)**: Add, rename, or delete columns. Supports **up to 12 columns in Local Mode** and **16 columns in Cloud Mode** (aligned with system port caps).
- **Rows (Records)**: Add, delete, and reorder records with up to **100 rows per table** to protect canvas performance.
- **Keyboard Navigation**: Press `Tab` to advance between cells, and `Enter` to commit edits and move down.
- **Auto-Snapshotting**: Saving changes in the grid editor commits a canvas history snapshot (`Ctrl+Z` compatible).
---
## 3. Downstream Consumer Node Consumption Modes: `[ 📄 Record | 📊 Table ]`
When you connect a Table Node's Royal Blue **`All Records`** bundle port into a downstream Text or Prompt Node, the consumer slot displays its own segmented consumption toggle: **`[ 📄 Record | 📊 Table ]`**.
### Mode A: `📄 Record` Mode (Row-by-Row Interpolation)
- **Independent Stepper**: Displays `[ < ] [ Record 1: Alice ] [ > ]` on the consumer node so you can step through rows independently.
- **Column Token Pills**: Surfaces clickable column pills (`[ + Name ] [ + Description ]`) in the pill tray above the template text field.
- **Inline Rich Pill Editor**: Tokens render as live inline badges (`[# Name: "Alice" ×]`) showing both the column schema and evaluated row value.
### Mode B: `📊 Table` Mode (Full-Table Markdown Injection)
- **Dataset Summary Badge**: Displays a clean status badge (`Full Table • N rows × M cols`).
- **`{{Table}}` & `{{TableTitle}}` Tokens**: Surfaces dedicated `{{Table}}` and `{{TableTitle}}` pills in the token tray.
- **Markdown Pipe Serialization**: Wherever you insert `{{Table}}` (or if left empty to pass through), Nodestr compiles the entire dataset into a GitHub-Flavored Markdown table:
```markdown
| Character | Role | Alignment |
| :--- | :--- | :--- |
| Lyra | Architect | Lawful Good |
| Vex | Vanguard | Chaotic Neutral |
```
- Pipe characters (`|`) and line breaks inside cells are automatically escaped so formatting never breaks.
---
## 4. Direct Connection to Output Hub or Document Exporter Node
You don't need an intermediate prompt node to view or export a table:
1. **Table Node → Output Hub**: Dragging a noodle directly from a Table Node's `All Records` port to an **Output Hub** input slot automatically compiles the entire table into a Markdown pipe table and renders it as a styled visual table inside the Output Hub's **`[ 👁 Rich Preview ]`**, while unlocking the **`Run Batch`** engine.
2. **Table Node → Document Exporter Node**: Dragging a noodle from `All Records` directly into a **Document Exporter Node's** `Table Data` port lets you export the dataset directly to **Excel (`.xlsx`)**, **CSV (`.csv`)**, **Word (`.docx`)**, **PDF (`.pdf`)**, **Google Sheets**, or **Google Docs**.
---
## 5. Schema Label Output Toggle ("Value Only" vs "Field/Value Pair")
When using `Single Record` mode or scalar column ports, you can toggle prefixed schema labels:
- **1-Click Footer Toggle**: Click the toggle pill on the bottom-right of the Table Node footer to switch between **`Value Only`** (e.g. `Samantha`) and **`Field/Value Pair`** (e.g. `Name: Samantha`).
- **Inspector Control**: You can also toggle this switch in the Right Sidebar Inspector under **Table Data & Schema**.
---
## 6. Universal Token Syntax & Automatic Schema Rename Propagation
- **Universal Token Regex**: Full native support for apostrophes (`{{Person's name}}`), typographic curly quotes, parentheses (`{{Weight (kg)}}`), hashes (`{{Item #}}`), and unicode characters.
- **Automatic Rename Propagation**: Renaming a column in the Spreadsheet Grid Editor automatically updates all downstream consumer node tokens in place.
---
## 7. Multi-Table Workflows, Group Nodes & Master Record Selector
- **Group Nodes**: Group Nodes act as organizing conduits that can receive **multiple tables simultaneously** on separate input handles and forward them cleanly to internal sub-graphs.
- **Master Record Selector Synchronization**: Connect a **Record Selector Node** (`Sync Out` handle) to multiple Table Nodes' Violet `Record Selector` input handles to step all connected tables in unison.