Dataviewjs to list tasks from DQL

What I’m trying to do

I am trying to generate a list of task from a DQL Query that can be reusable in different notes.

Things I have tried

I am calling a script from a note using

await dv.view('dv-pending-attendees')

The script is

const result = await dv.query(`
TASK
LIMIT 5
`)

if (result.successful) {
	dv.list(result.value.values)
}
else {
	dv.paragraph("~~~~\n" + result.error + "\n~~~~")
}

This returns:
image

When I would like to have that:
image

I believe this has to do with the dv.list syntax, but I cannot figure it out.
I tried:

  • dv.list(result.value.values)
  • dv.list(result.value.text)
  • dv.list(result.value.values.text)
    with no luck.
    Maybe the solution is to use another dv.xxx but I could not find which.

Anyone knows the syntax?
Thanks

You need to match the query with the function. So use LIST with dv.list(), TABLE with dv.table() and in your case TASK with dv.taskList().

So you might want to use dv.taskList(result.value.values, false)

Thanks a lot, that did it!
I am pretty sure I had tried it, but I must have missed it.