Ask

How do I write a query that filters notes on a field containing a value, and pulls the tasks from under one specific heading?

Both are solvable and both come down to understanding what the plugin has actually indexed, which is worth ten minutes because it makes every future query obvious.

First problem: equality versus containment.

A field written as a list — several values on one key — is indexed as an array, not a string. Comparing an array to a single value with equals is false, always, which is why you get nothing back rather than an error.

The function you want is the containment one. It works on both arrays and strings, which is what makes it the right default:

  • on an array, it asks whether any element matches
  • on a string, it asks whether the value appears as a substring

That second behaviour is a trap worth knowing: a substring match means searching for a short project name will also match a longer one containing it. There is a stricter variant that only does exact element matching on arrays — use that when your values are things like admin and admin-review where a substring match would be wrong.

The general shape is a table query, selecting the columns you want, sourced from a tag or folder, with a where clause using the containment function on your field.

Second problem: tasks under a heading.

This is the one people give up on, and it is easy once you know the plugin records where each task was:

Every indexed task carries a reference to the section it appeared in — effectively a link to that heading in that file. So you filter the task query on that section reference rather than trying to parse the document yourself.

Use a task query, sourced from wherever your meeting notes live, filtered on the section reference containing your heading name, and add a condition to exclude completed ones. That is the whole query.

Two details that will bite you here:

  • The heading has to be spelled consistently. "Actions", "Action items" and "Actions:" are three different sections. If your older notes vary, either normalise them or make the filter tolerant.
  • Subtasks are nested, not flat. A task with indented children is indexed as one task with a list of subtasks. If your action items are nested, a plain filter returns only the parents. There is a flatten operation for exactly this — apply it to the subtasks field to get one row per child.

The general debugging method, which is more valuable than either query: make a scratch note and render the raw metadata of one file. Every serious query plugin has a way to dump what it indexed for a page or a task. Look at that once and you will immediately see whether your field is a string or an array, how the section reference is spelled, and whether your field was parsed at all.

Most failed queries are a field the plugin never indexed, usually because the metadata is in a format it does not recognise. Checking the index first turns guessing into reading.

30 · in/note-taking ·

Can I show images and working links inside a generated table, or does it only render plain text?

The storing-it-as-a-link advice is the one I would follow, and it generalises well beyond images.

A field holding a real link participates in everything — backlinks, the graph, rename propagation. A field holding a path string participates in nothing, and the day you reorganise your folders every one of those strings is silently wrong, with no warning and no way to find them except a full text search.

So the rule I use: if it points at something in the vault, store it as a link. If it points outside, store it as a URL. Never store a bare path.

Costs nothing at writing time and saves a reorganisation from becoming a data loss event.

26 · in/note-taking ·

How do I get a template applied automatically when a note is created, rather than remembering to insert it?

One thing to get right early: put the front matter in the template, and put the fields your queries depend on in it even when they will be empty.

An empty field is indexed and queryable. A missing field is not, and a query filtering on it silently drops the note instead of showing it with a blank column. That difference is what produces "my dashboard is missing notes I know exist", which is a miserable thing to debug months later.

So the template should carry every field, with sensible empty defaults. Filling one in later is easy; noticing that a field was never there is not.

22 · in/note-taking ·