I’m new here and with Obsidian too. My English is not so good so be simple, and if you are French it’s Wonderfull !

I just try to see tasks of one folder with 2 conditions. The first one is ok (.where (t => !t.completed)) and woks good.
The second one doesn’t wok. I get no error but no result ! (.where (p => p.Statut === “En cours”)) Statut is a property and I should have one result with both 2 conditions, but I have not.

Things I have tried

dv.header(4, 'Tâches non complétées dans "MES PROJETS"');  
dv.taskList(dv.pages('"Serge/2-MES PROJETS"').file.tasks
.where (p => p.Statut === "En cours")
.where (t => !t.completed))

I tried =, I tried == , I tried === (I see it on the forum !)

Thanks for your help

We will need a bit more context - can you maybe show a screenshot of your metadata? (the place where you declared Statut)

Within javascript context the = is used for assignment of values. The == checks for equality, and the === is an even stricter equality checks.

So the question becomes that of how is Statut defined in one of your tasks. Or if on the note level, whether it’s a single value property or a list of values. In the latter case you need to do something like p => contains(p.Statut, "En cours"). But it all depends on how you’ve defined Statut.

Thank for answer
Here is screen copy

Statut is a single value

Statut is a single value
here is screenshot

it’s the template I used.
here is the right file

But that file is not in the folder that your query is referring to? So is there a file in that folder which actually has this property set to that value? Which also has non-completed tasks?

oh… it was the “modèle”
here is the good one

It’s most likely due to Statut being a file property, and not a task property. So if you change the order of your query it’ll most likely be OK. Try the following:

dv.header(4, 'Tâches non complétées dans "MES PROJETS"');  
dv.taskList(dv.pages('"Serge/2-MES PROJETS"')
  .where (p => p.Statut === "En cours")
  .where (t => !t.completed))
1 Like

Thank you ! that’s perfect,
I understand my mistake.
Thank you

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