List All File Inside the Current File Directory in Obsidian using Dataview

Preface

Simple way to list/index all file with the same directory with the current file.

Prerequisite

Needed plugins:

  • Dataview

Instructions

Just List All File

```dataview
LIST
WHERE contains(file.folder, this.file.folder)
```

Excluding This File

```dataview
LIST
WHERE contains(file.folder, this.file.folder) AND file.name != this.file.name
```

Conclusions

Yeah, that’s it. If you have a main folder where you differentiate by even bigger category (like Personal and Work) using folder, you can also add something like FROM 01. Personal so it only query from your personal profile.

References