obsidian-tracker icon indicating copy to clipboard operation
obsidian-tracker copied to clipboard

Is there a way to track only file with certain frontmatter?

Open jerrywcy opened this issue 4 years ago • 6 comments

I love this plugin very much, it works very fine for me.

But is there a way to track file with certain frontmatter?

For example, I have several file containing students' exam papers, each with a frontmatter like this:

---
exam-date: 2021-08-24
exam-student: [[Students/A]]
exam-score: 96
---

(Actually I used link to track both their studentID and their names in Dataview, because I have another folder in which I store all students' information individually in files' frotmatters)

So now I would like to track a certain student's score through the days(let's say student A), but when I tried to specify the frontmatter exam-score in searchTarget, the value will be the sum of everyone's score in that exam.

Is there is a way to track only file with frontmatter exam-student: [[Students/A]]?

jerrywcy avatar Aug 24 '21 06:08 jerrywcy

Maybe I can try to use regular expression and switch searchType to text?

However in every file exam-student may be before or after exam-score, which is very disturbing...

(I want a more elegant solution...)

I will have a try anyway.

jerrywcy avatar Aug 24 '21 06:08 jerrywcy

Yeah I tried but it seems that there are some problems with the [[]] format link...

explanation from regex101

jerrywcy avatar Aug 24 '21 07:08 jerrywcy

Acually, if possible, a filter like Dataview's WHERE will be best, but I fear it would be too hard to implement···

jerrywcy avatar Aug 24 '21 07:08 jerrywcy

Interesting!! Here is my solution. image In this solution, exam-score must be placed at the next line below student's name. You may want to use a template to help keep the format of a note.

I agree, it would be great if we have a filter. Will consider adding a parameter filter.

pyrochlore avatar Aug 24 '21 09:08 pyrochlore

In this solution, exam-score must be placed at the next line below student's name.

I agree, it would be great if we have a filter. Will consider adding a parameter filter.

Thanks a lot for the solution! I will certainly use it.

It will be so great if we can filter files through frontmatter, or better if not limited to frontmatter!

(To be honest, I haven't been replied so fast ever since I used Github... Thanks really a lot for that!)

jerrywcy avatar Aug 24 '21 14:08 jerrywcy

+1 for adding a parameter filter.

kevinpolisano avatar Aug 14 '23 13:08 kevinpolisano