What I’m trying to do
I’m trying to rewrite the text field in a task query (with FLATTEN ... AS text
) to create a grocery list from recipes containing the ingredients, but it seems to break the registerHandler
for the checkboxes, or however the setTaskCheckedInFile
event gets triggered (according to this. In other words, the checkbox status is not modified in the source file when clicked.
I’ve seen a s similar report on the task query not updating the source file when checking boxer after modifying the text field (Dataviewjs and taskList checking item does not update source when text modified?), only I’m not too familiar with dataviewjs so I’ll ask the question with respect to an example of a standard dataview query looking something like this:
TASK
FROM #Recipes
WHERE !completed
FLATTEN Ingredient + ": " + Quantity + "g" AS text
Assuming all items have a valid field Ingredient
and Quantity
, which is the case in my vault.
Things I have tried
The order of the where clause (before or after the flatten) does not matter either.
TASK
FROM #Recipes
FLATTEN Ingredient + ": " + Quantity + "g" AS text
WHERE !completed
I’ve tried to create a dataviewjs query by hacking my way to something working inspired by this example but to no avail, as soon as the field is replaced it stops updating the checkboxes.
Can anyone help me with this? Thanks in advance for a hint!