K
Docs
API ReferencePiecesSort List
🔃

Sort List

base.sortBase SetUtility

Takes a list and sorts it ascending or descending. If the list came from a Vault read, it auto-detects the table schema and lets you pick which column to sort by — no guessing field names. The sorted result becomes a ✨ Spark you can loop over or show directly.

When to use this
  • If the list came from a Vault read, the config panel auto-detects columns — just pick one
  • Leave 'Sort by' blank to sort a simple list of values (numbers or text) directly
  • Chain with a Loop piece to process sorted items one by one

On the canvas

This is what Sort List looks like when you place it on your flow. Each field below is something you configure in the inspector panel.

🔃
Sort List
base.sort
Utility
listrequired
{{result}}
by
coins (or leave blank)
direction
select
asrequired
sorted (becomes a Spark!)

Config fields

FieldTypeReqWhat it does
list
{{result}}
textyesList to sort 📋
by
coins (or leave blank)
textSort by 🔑
directionselectOrder
as
sorted (becomes a Spark!)
textyesSave result as ✨

Sparks this piece adds

After this piece runs, these values are available as sparks in every node downstream.

{{sorted}}arraySorted list
{{sorted.length}}numberNumber of items in sorted
{{sorted.0}}stringFirst item after sorting

Output ports

outputMoves on with the sorted list as a Spark
📐

In TypeScript, this would be…

Not something you need to write — just a look at what Kitcord does for you.

TypeScript
const sorted = [...rows].sort((a, b) => b.coins - a.coins);
// by column "coins", descending — {{sorted}}