When copying queries, be sure to keep the lines in order. You’ve switched the FLATTEN ... as ctx
and the WHERE ctx...
, which breaks the query.
Regarding the 2nd issue, I’ve already said the solution, put ctx.term.summary
into the display line. In other words, use this query:
```dataview
TABLE ctx.term, ctx.fileContexts, ctx.term.summary
FROM #abbreviation
FLATTEN contexts AS ctx
WHERE contains(ctx.fileContexts, [[Abbreviation Test Document]])
SORT file.name ASC
```
I’m a little uncertain about the sorting, but doing both on the file and the term seems superfluous, and doing sort on the full file object is usually a bad idea, so it’s better to use just the name part (and avoid any issue with other parts being used for sorting (i.e. the folder part).
Update: Corrected a typo with some extra quotes