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 | |
| Crash |
|
| Junky | |
| Omensetter’s Luck |
|
| Plato Complete Works | |
| The Lathe of Heaven |
|
| The Waves |
|
| V. |
|
| Fiction and the Figures of Life |
|
| Anti-Oedipus - Capitalism and Schizophrenia |
|
| The Logic of Sense |
|
up:: 🧪 Code Diary