How to query a note with multiple values in a YAML key?

Hello, fellow Obsidian users.

So let’s say I want to write a note about a fictional character and an event that he experiences.

In, for example, there is this Dataview query:

list from #plot
where actor = "John"

In an event note, “John meets”, there is this frontmatter:

tag: plot
actor: [John, Jane]

Now, the problem is that the Dataview query in doesn’t list “John meets”, whereas when I change it to…

tag: plot
actor: John

…it is being shown.

How could I let the event page detect the character page and still let the actor key have multiple values?

I’ve tried different symbols for the list, like semicolons, regular brackets, no brackets, apostrophes, …

Thank you for your help in advance!

1 Like

You don’t get “John meets” because if actor: [John, Jane] then actor = "John" is false. «equal» means «equal» and in that case John is one of the values in a list…
For that you need to use the function contains():

FROM #plot
WHERE contains(actor, "John")


Forgive another stupid question, but:

And from here:

Why in this case don’t we need quotes like this:



(sorry for the fast answer)

Am I incoherent? :slight_smile:

Yes, many times.

The question here (to not complicate the original request) is that you have values with simple words. You don’t have the risk to have a comma in the value (as the expression This is a single value, an expression with commas).

The answer in the linked post is “universal”, this one is “specific”.


I knew it was a stupid question, and now you have explained it to me I can see that it was a very stupid question.

Thank you very much for your time and kindness.

I think I should give up using Dataview and Obsidian. I am just too dumb. :frowning:

(Crestfallen) Angel

It helped! Thank you very much!

Don’t worry! It’s hard to comprehend Obsidian at first. I’m sure you’ll get this very soon.

1 Like

Please, no way.
You are one of the best helper here.
Your questions are rational, valid doubts.
And “rules” are just that, human constructions with many unstable foundations…
(my incoherency is so stupid as your question. Are they?)


You are never incoherent. You know that I (and many others) greatly admire your knowledge and kindness.

The answer I needed was already there in front of my eyes but somehow my brain hadn’t engaged.

Have a good weekend.



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