🏆
Top List
vault.topThe VaultVaultSorts a table by one column and hands back the top rows — a leaderboard in one piece. Each row gets a place number too ({{item.place}} in a Loop), and empty values always sort last. Filter it to make per-team or per-server boards.
When to use this
- →Loop over the list — {{item.place}} is 1, 2, 3… and every column is there too
- →Lowest first makes speed-run boards: the smallest time wins
- →Pair with Find Rank to also tell someone their own spot
On the canvas
This is what Top List looks like when you place it on your flow. Each field below is something you configure in the inspector panel.
🏆Vault
Top List
vault.toptablerequired
Pick a table…
columnrequired
e.g. xp
order
select…
limit
10 (up to 100)
filterColumn
Every row
filterOp
select…
filterValue
e.g. {{input.user.id}}
asrequired
top
found
empty
Config fields
| Field | Type | Req | What it does |
|---|---|---|---|
tablePick a table… | text | yes | Table 🗄️ |
columne.g. xp | text | yes | Sort by 🏆 |
order | select | — | Which way 🔃 |
limit10 (up to 100) | number | — | How many 🔢 |
filterColumnEvery row | text | — | Only rows where… 🔍 |
filterOp | select | — | Is… |
filterValuee.g. {{input.user.id}} | text | — | This value |
astop | text | yes | Save it as ✨ |
Output ports
foundAt least one row
emptyThe table (or filter) has no rows yet
📐
In TypeScript, this would be…
Not something you need to write — just a look at what Kitcord does for you.
TypeScript
const top = await db.all(
"SELECT * FROM levels ORDER BY xp IS NULL, xp DESC LIMIT ?",
[10],
);
top.forEach((row, i) => (row.place = i + 1)); // {{item.place}} in a LoopRelated pieces
More Vault pieces