Need help with dataview and inline task checkboxes in daily notes

I would like dataview to give me a summary of certain tasks in my daily notes. I want a table that lists the various tasks, and whether or not they have been checked off as done. This is for habit-tracking.

For instance, I want a list of various habits across the top, then a list of dates followed by an indicator of whether the task was checked or not.

Things I have tried

This works when I put in daily notes
yoga::
walk::

with the query:

table yoga, walk
from "daily"
sort file.name desc

But I want these to be checkboxes in the form of - [ ]

I’m only 3 days into Obsidian so consider me clueless. I have read the Dataview page on inline variables, but I am still baffled.

What I’m trying to do

Hi.

Don’t get me wrong, but I’m not sure if I should give you the solution. Why? As you said, you are playing Obsidian just 3 days ago and you need more time to be secure with some basics in Obsidian and also in Dataview plugin.

For example, there’s some confusion with inline fields and tasks… And dataview have tasks queries… And you need to structure your metadata accordingly to the way that dataview works.

My final point: without a more solid knowledge about this, I can give you a solution but you don’t understand how it works.

One suggestion: in your notes use this inline query to check how metadata is structured in that note

`$=dv.span(dv.current())`

(you need to enable js queries in dataview settings)

Sorry

1 Like

If you could point me toward the right beginner resource I am happy to teach myself. But it’s hard to know, as a beginner, where to look.

Do you know the dataview documentation?
https://blacksmithgu.github.io/obsidian-dataview/

Yes, I spend about an hour with it. That got me as far as making the query I mentioned above. But it assumes background knowledge of the overall system. For instance it talks about implicit fields, but not I was not clear what to do with them. I’m off to watch some dataview videos now.

Two or three things:

1 - Dataview works with metadata: implicit metadata (“implicit fields”) + created metadata (fields in yaml frontmatter or inline fields).

2 - About inline fields, you can use 2 types of fields:

## Full inline field - format `key:: value`

key:: This is a full inline field. You need to add the "key" at the start of a new line and the value is all the content in the same line (when you break the line the value stops).

## Inline fields

### [key:: value]
You can use this type of field anywhere (isolated, i the middle of your text, etc.). In this text I can use this field [key:: priority] and dataview recognize it as metadata.

### (key:: value)
You can also use this (key:: format) as in previous format. The difference in the type of brackets - "[" or "(" - is related to the way the field is rendered in the reading mode. If you activate in settings > dataview the "inline fields highlighting", the rendered output of this last format hides the "key" and shows only the value.

3 - Tasks in the format “- [ ] blahblah” - it’s related with obsidian. Dataview can query this type of tasks with task queries. You can also capture the data of this tasks in dataview table queries, but implies a more complex understanding of the structured of metadata. For now I don’t think you have the ability to jump directly to this type of queries. And remember: in tasks queries you can interact with the tasks (you can check or uncheck the tasks directly in dataview tasks results), but in a table you don’t have the “checkboxes” to interact with the tasks - it’s a static output.

2 Likes

Thanks for taking the time to explain this.

Exactly the explanation I was looking for too, thank you! I could not find any documentation which explained how to use an in-line field that didn’t start at the beginning of the line.

1 Like

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