How to list only inlinks from a particular folder?

What I’m trying to do

I want to have a list of all the inlinks going into the note I’m currently viewing, but only those linked from a particular folder.

Things I have tried

I searched this entire forum but for the life of me I can’t find anyone asking this question. The base code I’m using is this:

```dataview 
list without id file.inlinks 
where file.name = this.file.name

I’ve tried all kinds of “where” and “from” statements but to no avail.

Try the following queries:

## All files linking here
```dataview
LIST file.folder
WHERE contains(file.outlinks, [[]])
```

## From a given folder
```dataview
LIST
WHERE contains(file.outlinks, [[]])
  AND file.folder = "ForumStuff/f57/f57644/folderA"
```

The first one lists all files linking to the current note (with the folder that file is stored within), and the second lists only those from that given folder (which you of course need to change to a folder in your vault). Note that in this format you need to specify the full folder path.

Other variants could be achieved doing something like contains(file.folder, "f57") or startswith(file.folder, "ForumStuff") and so on.

Thank you so much, this works great!

And what if I want to have the same output placed in a table column and I want it to output for each file listed in the table?

Do you mean to do:

```dataview
TABLE file.folder
WHERE contains(file.outlinks, [[]])
```

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