Help realizing this workflow scenario, please

Things I have tried

Searching similar scenario(s) in this forum. Didn’t find any.
Trying to take various pieces of code or hints here and there. Didn’t succeed.
That’s why I’m posting this…

What I’m trying to do

I’m a teacher, and on a daily basis I would like to take note of what I do in each class.
I created a single note (.md) for each class I teach in (let’s call them “1A”, “2A”, “1B”, “2B”).
Each note has some informations on each class (say the names of the students, the topics I need to talk about etc).
I would like to be able to automatically populate the topic I taught in each class, starting from Daily Notes (core plugin).

For instance, in today’s Daily Note I would write

1A - Lorem Ipsum
2B - Dolor sit
1B - Amet consectetur

And I would like to see in the “page” of 1A something like this:
2021-09-13 - Lorem Ipsum

In the page of 2B something like this:
2021-09-13 - Dolor sit

and so on.

I can guess that this would be a great work for Dataview (or maybe even DataviewJS), but I’m not that good at using code…

As I don’t know very much about queries and programming language, any hint on how to improve my knowledge would be great, much more than only posting the query code.
Of course, if anyone has a better way of solving this problem (i.e. changing the workflow), please feel free to post suggestions!

I don’t know much about programming language either, but queries on dataview are pretty simple. For your case, write in your daily note :

  • class A:: Lorem Ipsum
  • class B:: Dolor sit
  • class B:: Amet consectetur

(avoid numbers in names, i couldn’t get it to work with them, i don’t know why). Then in you “pages” write :

```dataview 
TABLE file.day, class A
FROM "daily notes" (if the folder where you keep them is name like this)
SORT file.day DESC

A summary about how the plugin works

you have to have data in some files with its respective value, it can be written in one of these 2 formats :

  • inline fields : this format can be put anywhere on the file data::test
  • front matter : this format has to be written at the top of the file with the 3 dashes above and below
---
data: test
---

you can also pull data from the file via dataview added metadata, like in our example we pulled the date of the file with file.day
The data can be many types : dates, tags…
Then you can query the data with 3 views (table, list, task). For tables, you have to specify the column name which are the names of the data, in your example it’s date and file.day. You can also rename them with “AS” like file.day AS date
Then you can use FROM to specify the source, WHERE to filter and also SORT.
I think this will be enough for most of your use cases. But you can read the full documentation if you plan on using the plugin a lot.

1 Like