How can i write a basic dataview query that pulls the data only from the current note?

Things I have tried

What I’m trying to do

Hi everyone,
I’m trying to write a dataview query that searches the current note only for inline fields.

Case study: During brainstorm sessions i have an inline field Q:: that is a question that arises for me that i need to come back to. I also have an inline field process:: that identifies in my writing where i will need to come back and develop a specific learning asset, or exercise for the content i’m working up.

Ideally i want to be able to collate at the top of the note the current questions or processes that arose in this notes content so i have a quick at a glance summary of important next steps in the idea development of the brainstorm session.

I’ve searched extensively the web, here in the forum and i’ve tried so many things i’m a bit lost now lOL. I’m fairly new to it (though i did know and write SQL queries back in the day).
I’ve tried various things i found online …

LIST Q 
FROM [[ ]]
WHERE Q != (null)

and i’ve also tried variations of

LIST Q 
FROM this.file.name
WHERE Q != null

Nothing is working. Obviously i either get the syntax wrong (i’m still learning this) or it doesn’t fail outright but is return 0 results (and i have checked that i definitely have examples on the page that should be returning)

I’d be hugely grateful if someone had a solution for me!

Much thanks
Lisa

Good question! I do not think FROM accepts anything programmatic like this.file.path (or name or folder or whatever). WHERE does, however. WHERE file.name = this.file.name could replace your FROM line. (If you have files in different folders with the same name you might want to use file.path instead of file.name?)
You can either stack WHERE conditions vertically or combine them on the same line with AND, either works.
Happy querying!

1 Like

thankyou! this worked!.. much thanks.

3 Likes

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