Dataview Get Inline Tags from Under Specific Heading

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 the flatten 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.

I am also new to obsidian and seem to have some similar issues as well.

This is my note:

exp_test
  • project:: #project
  • sample:: #sample
  • exp:: #exp
exp_test1
  • project:: #project
  • sample:: #sample
  • exp:: #exp1

my query:

TABLE project, sample, exp
FROM "Main" 
FLATTEN file.lists AS L 
WHERE meta(L.section).subpath = "exp_test"
WHERE contains(L.exp, "exp")

I have some sort of results, but it doesn’t seem to separate my two section and give me the follow result. when I added AND between the two WHERE clause, it doesn’t work…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.