# Select Row

<!-- meta: type=select-row; location=Database; category=Step (action); platforms=Joomla and WordPress (where applicable) -->

## Overview

Select Row is a **Step (action)** in **Database**. Queries a database table and returns matching rows to the payload.

When the flow reaches this step, JOrchestrator executes **Select Row** against your linked site or an external integration, using the field values you set on **General** and **Design**. Downstream steps can read the output payload fields defined for this node.

## Why use this node

Select Row is a **action step** in the **Database** group. Action steps run in the middle or end of a flow. They perform work on your CMS, call external services, or transform data for the next step.

Typical reasons teams add **Select Row** to a flow:

- Look up a user or article by ID from earlier payload data
- Fetch the latest matching row before deciding an If branch
- Drive Iterator loops from SQL query results

## Example workflows

Common patterns on the canvas:

1. **Trigger or Webhook** → upstream steps → **Select Row** → **Send Email** or CMS update
2. **Scheduled trigger** → **Select Row** → **Debug** (while testing) → production action

## How to set it up

Optional JOINs (INNER, LEFT, RIGHT, CROSS) with ON conditions, then WHERE filters. Use qualified columns in ON (e.g. a.id = b.user_id).

## Good to know

Drag upstream payload fields into WHERE values with {{placeholders}}.

## Properties panel

The designer shows these tabs for this node:

| Tab | Purpose |
|-----|---------|
| **Info** | Plain-language description and output payload fields for downstream steps |
| **General** | Canvas label and read-only node ID |
| **AI** | Optional assistant to help draft settings from plain language |
| **Design** | Node-specific configuration fields |

### System (automatic — not edited by the user)

These fields are managed by the designer or runtime — you do not type into them directly:

| Property key | Label | Type | Required | Visible when | Notes |
|--------------|-------|------|----------|--------------|-------|
| `_nodeId` | Node ID | `node-id` | No | — | — |
| `joins` | Joins | `select-joins-builder` | No | — | — |
| `whereClause` | WHERE Clause | `where-clause-builder` | No | — | — |

### User-configured — General tab

| Property key | Label | Type | Required | Visible when | Notes |
|--------------|-------|------|----------|--------------|-------|
| `label` | Label | `text` | No | — | Node label |

### User-configured — Design tab

| Property key | Label | Type | Required | Visible when | Notes |
|--------------|-------|------|----------|--------------|-------|
| `tableName` | Table Name | `select` (`#__content` \| `#__categories` \| `#__users` \| `#__usergroups` \| `#__menu` \| `#__modules` \| `#__modules_menu` \| `#__extensions` \| `#__assets` \| `#__languages` \| `#__session` \| `#__tags` \| `#__ucm_content` \| `#__ucm_base` \| `#__contentitem_tag_map` \| `#__finder_links` \| `#__finder_terms` \| `#__finder_tokens` \| `#__finder_tokens_aggregate` \| `#__finder_types` \| `#__newsfeeds` \| `#__overrider` \| `#__redirect_links` \| `#__update_sites` \| `#__update_sites_extensions` \| `#__updates` \| `#__viewlevels` \| `#__workflow_stages` \| `#__workflow_transitions` \| `#__workflows`) | **Yes** | — | Select table or enter custom |
| `selectedColumns` | Select Columns | `column-selector` | No | — | — |

### CMS site configuration (not on this node's properties panel)

Credentials, API keys, mailers, SMTP, and integration defaults are configured in the CMS plugin under **Node Configuration**, not per step on this node. Link the flow to a domain before testing CMS-backed fields.

## Output payload fields

After this step runs, later nodes can reference these fields using placeholders such as
`{{select_row.rows}}`.

| Field key | Type | Description |
|-----------|------|-------------|
| `rows` | array | Array of row objects from the query. |
| `sql` | string | SQL query that was executed. |
| `tableName` | string | Database table name used by the node. |
| `rowCount` | number | Number of rows returned or affected. |

## Validation rules

- **Table Name** (`tableName`) must be filled before the flow can be saved.

## Related nodes

Other steps in the same area of the palette:

- **Custom Table** (`create-table`) — Database
- **Delete Row** (`delete-row`) — Database
- **Insert Row** (`insert-row`) — Database
- **Update Row** (`update-row`) — Database
