> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nrev.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Sort Rows

> Sort your table by any column—ascending or descending—to control the order of your data.

## What It Does

* Sorts rows in your table based on a single selected column
* Supports text, number, and date columns
* Keeps your original structure and column names
* No columns are added, removed, or renamed
* Cleanly reorders your dataset for downstream logic

> 🔄 Whether you're teeing up your next filter or sequencing actions, this node helps you get your priorities straight.

***

## 🏁 Getting Started

<Frame>
  <img src="https://mintcdn.com/nurturev/XbOQSoFzT8ExEzUj/images/Sort%20Rows%20node%20configuration.png?fit=max&auto=format&n=XbOQSoFzT8ExEzUj&q=85&s=346dfaf84a95cca2650f54b988098bf1" alt="Sort Rows node configuration" style={{ borderRadius: '0.5rem', width: '100%', margin: '1.5rem 0' }} width="1180" height="1664" data-path="images/Sort Rows node configuration.png" />
</Frame>

<Steps>
  <Step title="Add the Node">
    Drag the **Sort Rows** node into your canvas and connect your data.
  </Step>

  <Step title="Choose a Column to Sort">
    Select a column from the dropdown—like `lead_score`, `created_at`, or `region`.
  </Step>

  <Step title="Select Sort Order">
    Choose **Ascending** (A→Z, 0→9) or **Descending** (Z→A, 9→0).
  </Step>

  <Step title="Run the Node">
    The output will be your same dataset, neatly reordered based on your choice.
  </Step>
</Steps>

***

## Inputs

### 🛠️ Required Fields

* **Column to Sort (✅)**\
  Choose one column to sort by.\
  *Why it matters:* This determines how your rows are ordered for next steps like filtering or ranking.

* **Sort Order (✅)**\
  Choose `Ascending` or `Descending`.\
  *Why it matters:* Controls whether high-priority leads rise to the top — or you surface older records first.

***

## Output

Returns a sorted version of your input dataset:

* All rows and columns are preserved
* The table is reordered based on your selected column and direction
* No new columns (like `sort_index`) are added

***

## 🚀 Example Use Cases

| Scenario                        | Setup Example                        |
| ------------------------------- | ------------------------------------ |
| Prioritize high-intent leads    | Sort by `lead_score` (descending)    |
| Display oldest activity first   | Sort by `last_seen_at` (ascending)   |
| Group data alphabetically       | Sort by `company_name` (ascending)   |
| Prep for deduplication or merge | Sort by `created_at` or `row_number` |

***

## ✨ Pro Tips

<Tip>
  Use this node right before filtering to get top-N records, or to prepare clean groupings.
</Tip>

<Tip>
  Need multi-level sorting? Chain multiple Sort nodes—each handles one level.
</Tip>

<Tip>
  Sorting is stable: rows with equal values will maintain their relative position.
</Tip>

***

## ⚠️ Important Considerations

<Warning>
  Only one column can be sorted per node. For multi-level sorts, stack Sort nodes in order.
</Warning>

<Warning>
  Column must be selected from the dropdown. If upstream structure changes, you’ll get a UI error to reselect.
</Warning>

***

## 🛠 Troubleshooting

| Issue                    | Cause                           | Fix                                       |
| ------------------------ | ------------------------------- | ----------------------------------------- |
| Output looks unsorted    | Sort direction may be incorrect | Try toggling between ascending/descending |
| “Column not found” error | Column changed upstream         | Reselect column from dropdown             |
| Sort didn’t apply        | Column not selected             | Make sure both fields are set before run  |

***

## 📝 FAQ

<AccordionGroup>
  <Accordion title="Does this node change any columns?">
    Nope. It simply reorders rows—no columns are added, dropped, or renamed.
  </Accordion>

  <Accordion title="Can I sort by more than one column?">
    Use multiple Sort nodes if you need multi-column sorting (e.g. region then score).
  </Accordion>

  <Accordion title="What if I forget to select a column?">
    The UI will block the run until all required fields are filled.
  </Accordion>
</AccordionGroup>

***

## 💰 Pricing

> The Sort Rows node is **free** — no credits required.

***

<p style={{ fontSize: '1rem', fontWeight: 'bold', marginTop: '1.5rem' }}>
  Clean order, clean play. Sort rows to spotlight what matters — and route with intent.
</p>
