After searching through the forum here I still can’t find the answer so had to make a new post. Sorry if this is previously asked.
I want to make a table of all the meeting notes where the yaml array “attendees” includes, lets say “Person A”.
With regular dataview I am able to to this with:
```dataview
TABLE
WHERE contains(attendees, "Person A")
However, I would like to filter notes in the same way (“array contains”) with a dataviewjs in a templater template but can’t figure out how. Since it is an array the regular .where(p => p.attendees ===“Person A”) does not work.
Could anyone give me a tip on how I could add the filter yaml array “attendees” includes “Person A” to the dataviewjs query below:
“attendees” are a list of strings. The frontmatter of a meeting note could look something like this:
---
title: meeting title
date: 2022-12-06
noteType: meeting
project: project A
attendees:
- person A
- person B
- person C
---
I would like to add the new filter so that only notes included in the table are those where key noteType=meeting and where “attendees” contain “person A”.
The question mark is needed to avoid errors if/when the attendees field is missing. With the question mark the code gracefully exits that statement, whilst without it it would cause dereferencing a null value (which is no good).