---
title: "Query your Markdown notes as a table or a board"
author: Pedro Thomaz
source: https://coffeetext.app/blog/query-markdown-notes-table-board
---

# Query your Markdown notes as a table or a board

> Checked November 2026 against [Obsidian's Bases help](https://obsidian.md/help/bases). Coffee isn't affiliated with Obsidian.

Once notes carry a few properties in their front matter, such as `status: doing` or `due: 2026-11-20`, you start wanting to see them together. Every project that isn't done. Every book you've rated 4 or more. Every client note in one folder, with its next date beside it.

In Coffee you write that as a short block in any note, and the list appears under it.

## A first query

A query is a code block marked `query`: three backticks and the word `query` on the line above it, and three backticks on the line below, as for any fenced code block. Put these lines in one, in any note:

```query
from: #project
where: status != done
show: status, due
sort: due
```

Under the block, Coffee draws a table: each note tagged `#project` whose status isn't `done`, with its title, status and due date, earliest first. Click a row and that note opens.

The file keeps only those lines. Open the note in another editor, or export it, and you see an ordinary code block.

## Where the values come from

A query reads each note's front matter, the `key: value` lines between two `---` lines at the top. If front matter is new to you, [what front matter is](https://coffeetext.app/blog/what-is-front-matter) explains it. A note like this:

```
---
tags: [project]
status: doing
due: 2026-11-20
owner: Ana
---
# Website redesign
```

has the fields `status`, `due` and `owner`. A list, such as `tags: [a, b]` or one item per line, becomes the items joined with commas. Nested YAML is left out.

Four fields are there for every note without writing them: `title`, `folder`, `tags` and `modified`, the date the file last changed. Tags include `#tags` in the text as well as front matter ones.

## The lines a query understands

| Line | What it does | Example |
|---|---|---|
| `from:` | Which notes: a tag, a folder, or `all`. Separate several with commas | `from: #project, Clients` |
| `where:` | Conditions, joined with `and` | `where: status != done and priority >= 2` |
| `show:` | Columns after the title | `show: status, due, owner` |
| `sort:` | The field to sort by, and `desc` for the other way | `sort: due desc` |
| `limit:` | How many notes at most, 200 unless you say | `limit: 20` |
| `view:` | `table`, or `board` for cards in columns | `view: board` |
| `group:` | The field a board's columns come from | `group: status` |

A few details:

- **Tags include the ones nested under them.** `from: #work` finds `#work/acme` too, and a folder includes the folders inside it.
- **Conditions** use `=`, `!=`, `<`, `>`, `<=`, `>=` and `contains`. `contains` ignores case and accents, so `owner contains ana` finds Ana.
- **Numbers compare as numbers**, so 10 comes after 9. Dates written year first, such as 2026-11-20, compare in date order. Anything else compares as text, ignoring case.
- **A note without the field** doesn't pass a `<`, `>`, `<=` or `>=` condition, and comes after the others in an ordinary sort.
- **Without `sort:`** the notes are in title order.
- **A line starting with `//`** is left out, so you can keep notes to yourself inside the block.
- **A line Coffee can't read** is said above the view, in plain words, so a typo doesn't fail quietly.
- **Private notes are never listed.**

## A board

Add `view: board` and the notes become cards in columns, one column for each value of the group field, in the order they're first met. Notes with no value go in a None column at the end.

```query
from: #project
view: board
group: status
show: owner
```

That gives a column for each status, each card showing the note's title and its owner. If you leave out `group:`, the board groups by the first field in `show:`, or by `status`. A card opens its note when you click it. To move a card to another column, change the property in the note; the board follows.

## More to copy

Books you rated highly, best first:

```query
from: Reading
where: rating >= 4
show: author, rating
sort: rating desc
```

Notes changed recently, across the whole library:

```query
from: all
show: folder, modified
sort: modified desc
limit: 15
```

Open client work, by who's on it:

```query
from: #client
where: status != closed
view: board
group: owner
show: due
```

## When it updates

Coffee reads the notes in the background, so a big library doesn't hold up typing. When notes change, on disk or as you save, it reads them again a moment later and the table or board follows. A table shows the first 100 rows and says how many more there are, and a board shows 30 cards a column.

## How this compares

Obsidian has [Bases](https://obsidian.md/help/bases), a core plugin for database-like views of notes from their properties. Its help describes table, list, cards and map layouts, editing properties from the view, and formulas that work out new values from other properties. A base can be its own `.base` file or a block in a note. That's more than Coffee's query does.

Coffee's query is deliberately smaller: a few lines you can read, a table or a board, and a click to open the note. It doesn't edit properties from the table, and it has no formulas. If you need those, Obsidian is the better fit, as [Coffee vs Obsidian](https://coffeetext.app/blog/coffee-vs-obsidian) says. Coffee and Obsidian read the same front matter, though, so properties you add for one show up in the other.

## Questions

### Is Coffee's query block the same as Dataview?

No. The syntax is Coffee's own, and a Dataview or Bases block from Obsidian shows as text in Coffee. The properties they read are the same front matter, so the notes themselves work in both.

### Can a query read tags written in the text?

Yes. `#tags` in the text and tags in front matter both count, and a tag includes the tags nested under it.

### Does a query change my notes?

No. It only reads them. The note with the query keeps just the lines you wrote, and clicking a row opens the note it names.

### Can I sort by a date?

Yes, if the date is written year first, such as 2026-11-20. `sort: due` puts the earliest first, and `sort: due desc` the latest.

### Are private notes included in queries?

No. Private notes are always left out.

Query blocks are a Mac feature, on macOS 15 or later. Coffee for iPhone and iPad opens the same notes but doesn't have query blocks. It's free for 14 days without a card, then €3 a month, €29 a year, or €79 once with two years of updates. One purchase covers the Mac, iPhone and iPad.

---

Written by Pedro Thomaz, who makes Coffee, a Markdown editor for the Mac on macOS 15 or later, and for iPhone and iPad. It's free for 14 days with no card or account, then €3 a month, €29 a year, or €79 once with two years of updates. More at https://coffeetext.app/llms-full.txt
