mdelobelle / metadatamenu

For data management enthusiasts : type and manage the metadata of your notes.
https://mdelobelle.github.io/metadatamenu
MIT License
534 stars 28 forks source link

Dataviewjs queries not working in Lookup field types #717

Open guille2286 opened 3 months ago

guille2286 commented 3 months ago

I'm having an issue with the lookup field type. I've set up a lookup and it isn't returning any results.

This is what I've done: I've set up a "test" class in Metadata Menu and added a field "ts" with the field type set to lookup. I configured the lookup field with the following Dataview query:

dv.pages('"test_folder"')

test_folder is a folder located in the root of my vault, and there are a few notes inside of it. However, when I add the fieldClass: test to a note and then add the "ts" field, it doesn't retrieve any links to the notes within "test_folder".

Both JavaScript Queries and Inline JavaScript Queries options are enebled in the Dataview settings.

What I’ve Tried: To troubleshoot, I ran the following DataviewJS code in a separate note:

dataviewjs
const pages = dv.pages('"test_folder"');
dv.list(pages.file.name);

That worked perfectly, listing the names of all the notes within test_folder. This makes it even more confusing why the lookup field in Metadata Menu isn't working as expected. Even though the standalone DataviewJS query works, the lookup field in the Metadata Menu isn't pulling in the expected links when used with fieldClass: test. I'm not sure why the lookup isn't functioning as expected.

Does anyone know what might be going on or how to fix this? Any help would be greatly appreciated!

PippoGot commented 1 month ago

Same issue here. Apparently using only the folder name is broken, I managed to solve using the path to the folder. However, thedataview codeblock with only the folder name is broken for me, so maybe it is a plugin conflict?