How can I query a multifile field for one link?

What I’m trying to do

Table due, corelink
From "Projects"
Where Status != completed
Where corelink
Where corelink = "[[corelink- 1]]"
Sort due asc

I need help formulating the second ‘where’ query above. Corelink is a multifile field which can contain a list of links. How do I correctly syntax a query to search for one specific link.

Things I have tried

Various syntax! Reading the dataview help. Searching the forum.
New to this. I would really like to learn some basic sql so any pointers to first steps reading or sources welcome!

I think you need to use contains() instead of = :blush:

After a quick test, this seems to work for me:

// Rest of the query

Where corelink AND contains(corelink, link("corelink- 1"))

// Etc...

I had to use link() as it wasn’t working using simply "[[corelink- 1]]"
(Sorry, it’s been a very long time since I used Dataview :sweat_smile: )

Thank you so much for taking the time and working this out. I don’t think I would have gotten there.
That works great. Now I can work back along what you did and learn more. Thank you.

1 Like

You could use [[your link]] also, that is without the quotes. With the quotes it becomes a text string.

1 Like

Ah :bulb: ! This is what I failed to remember earlier :innocent: !

Thanks holroy :smile: !

// Rest of the query

Where corelink AND contains(corelink, [[corelink- 1]])

// Etc...

So

  • Where corelink AND contains(corelink, link(“corelink- 1”))
    Says, look for a link with this string
  • Where corelink AND contains(corelink, [[corelink- 1]])
    Says, look for this link.
    If I understand right. Thank you.

Both those statements are looking for a link in a list, but they just use two different mechanisms to create the link.

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