I have several daily notes, let’s name them by date. (e.g. 2023-03-01.md, 2023-03-02.md)
2023-03-01.md
#workout
bench press
10 x 8
10 x 7
dumbbell press
20 x 8
20 x 7
other unrelated list item 1
other unrelated list item 2
2023-03-02.md
#workout
squat
110 x 8
120 x 7
hacksquat
120 x 8
120 x 7
other unrelated list item 1
other unrelated list item 2
I want to have a dashboard that collects all the workout items on a single page. Like a table with two columns, one is the filename containing the #workout item, the other is the #workout item content. (I want it keeps its original nested structure, don’t flatten). Just like:
2023-03-01.md
#workout
bench press
10 x 8
10 x 7
dumbbell press
20 x 8
20 x 7
2023-03-02.md
#workout
squat
110 x 8
120 x 7
hacksquat
120 x 8
120 x 7
Things I have tried
I have read the document. I know there is an implicit field called file.lists which collects all the lists in a file. but I don’t know how to display it in an original nested way.
file.lists.text will display the flattened result which is not the result expected.
I also tried not get what I expected.
list without id
L.text
from #workout
flatten file.lists as L
where contains(L.tags, "#workout")
I search several keywords (group by tag, keep nested item) but only got flattened examples. Please point me out a way to solve this. Thanks in advance.
title: DVJS10_filter_fLists_get_list_items_and_taskList => 1.To gather the file.lists 1.1 To get list items 1.2 To filter by L.tags 2.To display the result as list items [with the desired structure]
collapse: close
icon:
color:
```dataviewjs
// M11. define FLST: gather all relevant List items
// For List_items: !L.task
// For Task_items: L.task
// #####################################################################
let FLST = dv
.pages('"100_Project/01_dataviewjs/01_by_example/Q33_workout/Q33_test_data" AND #workout')
.file.lists
.where((L) => !L.task)
.where((L) => dv.func.contains(L.tags, "#workout"));
// M31. output FLST:
// #####################################################################
dv.taskList(FLST, true);
```