Hello, I am pretty new to Obsidian and Dataview.
I capture things like Tweets and Youtube videos on my Daily Notes page using the QuickAdd plugin when on my phone. I have each of these under their own heading, but with similar inline tag names. The structure is something like this:
Tweets Heading
- Description:: Description of tweet in my own words
- Link::
[Link](raw-twitter-link)
- Linktype:: Tweet
- Tags:: #tweet #and #other #various tags (but not #youtube)
- Embed::
<bulleted embed under this so its collapsible by hitting Embed>
Youtube Heading
- Description:: Description of video in my own words
- Link::
[Link](raw-youtube-link)
- Tags:: #youtube #and #other #various tags (but not #tweet)
- Linktype:: Video
- Embed::
<bulleted embed under this so its collapsible by hitting Embed>
What I’m trying to do
I want to use Dataview to query my Daily Notes and extract each individual tweet/video into a table, with each inline field as a field. I have gotten something very close using the following query:
TABLE description, tags, link
FROM "Daily Notes"
FLATTEN description
WHERE contains(tags, "#tweet")
I am using flatten
in order to separate each individual tweet or video when I have multiple for a given day, but this does have the added effect of creating duplicates in the tags
and link
fields. It seems to aggregate them all up for each separate entry.
Things I have tried
-
I have tried using
flatten
on other fields. -
I also saw some people have success with using the
meta(link).subpath
function and having the inline fields as bullets under it, but when I tried that I had trouble parsing the inline fields as that rather than just raw text. -
I also tried filtering by adding that Linktype field and associated
WHERE contains()
clause, also to no avail. I know the problem is likely theflatten
clause, but I am not sure how to fix it.
Ultimately I just want to be able to have a table that filters these two types of things from my daily notes in a discrete (as in, one tweet or video and its associated metadata per row) and non-redundant fashion. As an added bonus I would like to avoid having to use DataviewJS, if possible.
Any help would be appreciated.