Meta
up:: π§ͺ Code Diary
type:: #log/code
tags:: #on/snippets
language:: Plugin - Dataview
program:: Obsidian
topics:: Coding
Get list items with a tag and display without the tag
Language:: Plugin - Dataview
Program:: Obsidian
URL:: Reddit - Dataview Lines with Tag
Summary
Use dataview and regard to get and show items with a tag
Code
TABLE WITHOUT ID string(link(rows.file.link, rows.title)[0]) AS class, regexreplace(list(rows.L.text), "#exam", "") AS "exam"
FROM "3_semester"
FLATTEN file.lists AS L
WHERE contains(L.tags, "#exam")
GROUP BY file.link
Explanation
I use this snippet to list lines tagged with β#examβ in my folder "3_semester", which I adapted from this discussion. To show the tag too just remove the regexreplace().
Result
class | π₯ |
---|---|
After World |
|
Blindsight |
|
Blood Meridian | |
Omensetterβs Luck |
|
Plato Complete Works | |
The Lathe of Heaven |
|
The Waves |
|
V. |
|
Anti-Oedipus: Capitalism and Schizophrenia |
|
The Logic of Sense |
|
Fiction and the Figures of Life |
|
up:: π§ͺ Code Diary