I’m a psychologist, I used to do therapy notes at notion, using one file for each session, but I think it would be better to use only one file to record all notes. When I need to find some info, it’s hard to search the notes opening file per file. But I don’t want to lose the organization multiple files brings.
Searching for solutions I encountered the DATAVIEW plugin and I almost got what I wanted.
You really need to read it the guy who solved it really knows how to use Dataview
summary:
You need first to apply a heading to each session in your note and each metadata of each “session” must be an item of a list below the heading.
then you need to refer to the position of the element of the list for dataview to find it.
TABLE without ID
rows.L.Session[0] as Session,
rows.L.Date[1] as Date,
rows.L.Payment[2] as Payment
FROM #test
WHERE file.lists
FLATTEN file.lists AS L
WHERE contains(meta(L.section).subpath, "Session")
GROUP BY file.name + meta(L.section).subpath
SORT rows.file.name ASC
Each person would have one folder, inside that folder I’d have:
Session notes (which is the ones I want to put in the dataview)
Dataview (where I can rapidly verify which sessions were paid or not and when it happened, and maybe some “title” for each session)
Case Conceptualization (where I’d put important information)
Treatment Planning (what I’m planning for this person)
You’re touching on various subjects when asking this request, but here is an example note with a working query:
## Session 2
- (Session:: Session 2) [date:: 06/09/2024] [payment:: 06/09/2024]
- (Session:: Session 2b)
[date:: 06/16/2024]
[payment:: ]
## Session 1
- (Session:: Session 1) [date:: 06/01/2024] [payment:: 06/10/2024]
Introductory stuff...
## Query
```dataview
TABLE WITHOUT ID item.Session as Session, Date, Payment
WHERE file = this.file
FLATTEN file.lists as item
WHERE item.Session
FLATTEN date(item.date, "MM/dd/yyyy") as Date
FLATTEN date(item.payment, "MM/dd/yyyy") as Payment
SORT Date desc
```
First of all I’m using WHERE file = this.file to limit the query to only this one file. You could use notation like already suggested, but there are some caveats with your original and that suggested notation:
With your original notation all the fields are gathered up into unconnected lists, as showcased in the linked post. This is because all fields have been declared at the page level (as opposed to in a list or task context)
With the suggested usage of lists, you can get it to work, but you need to keep the order of list items in that exact order related to your headings, and you can’t have multiple sessions under the same heading. However, since the fields now are within lists, it can be referenced through the index notation
With my suggested notation, a given session is contained within one list item, which makes referencing it a lot easier.
Thirdly, you’re not using a date format which Dataview understands as a date directly, so you’ll need to use date(text, format) to transform it back from a text into a date before you can use like an ordinary date.
So after using FLATTEN date(...) as variable where we store the result of that date transformation, we can present the result you wanted, and you can view the summary of the sessions with payment information.
Also notice how you can vary between ( ... ) and [ ... ] depending on whether you want the key name to be hidden or not.