Search dataview for files where metadata does not contain linke

What I’m trying to do

I am trying to use dataview search to find files that DO NOT contains a link to my person note in the ‘lead’ parameter. I have two types of notes; 1) person notes that have the file name ‘@ name’ and 2) project notes that have a parameter called ‘lead’ that will include a link to a person note. When I review my projects, I first look at all those where I am the lead (WHERE Lead [[@ my name]]. But I cannot get the search to work where it is anyone else/not me.

For clarity, this is what I use to create a table of all those projects where I am the lead and it works fine:

TABLE without ID project AS "Project", target-publication as "Target", output-type as "Type", output-status AS "Status", file.link AS "Output Note"
FROM !"X PKM"
WHERE contains(notetype,"output") AND published = false and peer-reviewed = true AND !contains(output-status, "submitted") AND !contains(output-status, "In press") AND Lead = [[@ my name]]
SORT updated desc

This is what I have tried to get all projects managed by other people but it returns a blank table:

TABLE without ID project AS "Project", target-publication as "Target", output-type as "Type", output-status AS "Status", file.link AS "Output Note"
FROM !"X PKM"
WHERE contains(notetype,"output") AND published = false and peer-reviewed = true AND !contains(output-status, "submitted") AND !contains(output-status, "In press") AND !Lead = [[@ my name]]
SORT updated desc

Things I have tried

I have tried

  • !Lead = [[my name]]
  • !contains(Lead, [[@ my name]]

I have also tried searching forum.obisidan, reading the Dataview help pages and I even tried Generative AI.

If your name was “John Doe”, what would be the actual for name of your person note?

To get all lead not being a link you could try to do WHERE ! typeof(lead) = "link" (or WHERE typeof(lead) != "link")

For comparing a given link with spaces and so, I often use lead = link("John Doe") or similar.

Hi holroy,

Thanks for the suggestion. I’ve had a play and cannot get it to work.

I thought I’d try to get typeof working with the positive (all that do contain a link [[@ John Doe]] before trying the negative. To get all Lead that do contain the link, I tried this but it returns nothing:

LIST
FROM !"X PKM"
WHERE typeof(lead) = [[@ John Doe]]

and

TABLE without ID project AS "Project", target-publication as "Target", output-type as "Type", output-status AS "Status", file.link AS "Output Note"
FROM !"X PKM"
WHERE typeof(lead) = [[@ John Doe]]

I also tried putting the link in quotation marks but it didn’t make any difference:

LIST
FROM !"X PKM"
WHERE typeof(lead) = "[[@ John Doe]]"
TABLE without ID project AS "Project", target-publication as "Target", output-type as "Type", output-status AS "Status", file.link AS "Output Note"
FROM !"X PKM"
WHERE typeof(lead) = "[[@ John Doe]]"

You misunderstood some of my examples, so let me try another time and write out the full queries. The first thing I attempted to talk about was a query to locate any notes of yours which had a property called lead where the content was not an actual link. To get this list you can do:

```dataview
LIST
FROM !"X PKM"
WHERE typeof(lead) != "link"
```

The second thing I tried to find out was whether your person notes was actually named like @ John Doe or John Doe or something entirely else. But to get a list of those notes having a link to notes named like the first example here you should be able to use:

```dataview
TABLE WITHOUT ID project as "Project",
  target-publication as "Target",
  output-type as "Type", output-status AS "Status",
  file.link AS "Output Note"
FROM !"X PKM"
WHERE lead = link("@ John Doe")
```

If you want the opposite, that is any projects not lead by John Doe, you’d replace the last line with WHERE lead != link("@ John Doe")

Hi holroy,

Ah, thanks so much for taking the time to explain. I understand now and have it working correctly.