I have a number of individual notes for various books I’ve read, with a YAML field for “author.” This works great with Dataview, except when there are multiple authors of a book. I assumed I could just add another YAML line “author: Sample Author” to add the second author, but then Dataview does not return results for either author.

Does anyone know how to change my query so it will return results for either author? Is this possible?

My current search is:

dataview TABLE without ID link(file.link, title) as "Title", author FROM #books Where author = "Sample Author"

  • Tenebris Nox
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Do the variables in the single-line array need square brackets?

      • Tenebris Nox
        link
        fedilink
        English
        arrow-up
        3
        ·
        1 year ago

        Sorry. I just looked through the Dataview documentation and found that my inline data needed double-quote marks rather than brackets. Like this:

        Writer:: "John Byrne", "Mike Mignola"

        It works now and solves an issue I was having. Thank you.

      • Tenebris Nox
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        Thanks.

        I tried it out and if it’s placed in the front-matter at the top of the note like this it works:

        Writer: [John Byrne, Mike Mignola]

        Unfortunately, most of my data is in the body of the notes using double-colon syntax like this - and it doesn’t get picked up by the Dataview query:

        Writer:: [John Byrne, Mike Mignola]

        Am I missing something?