Indirect query match / 2nd degree of "closeness"

Let me first explain what I mean by “closeness”. Here’s an example:
image

Between me and a product manager i work with there is a closeness of the 1st degree:
image

Between me and his A team there is a closeness of the 2nd degree:
image

It’s much easier for me to define what PMs I work with, rather than teams, since Product Managers can have 2 or even 3 teams attached to them. Which means my note links only to PMs, and teams are 2nd degree close to me.

I have this dataview query in every dev-team:

TABLE WITHOUT ID
file.link AS "Related people",
Team,
Position
FROM [[#]]
WHERE type = "person"

Each dev-team has this set of meta-data that describe it:

---
type: team
---
PM:: [[LINK DO THE PM]]

Whereas a note describing me has this:

---
type: person
---
Works-with:: [[LINK TO THE PM]], [[LINK TO YET ANOTHER PM]]

How can I rebuild the dev-team snippet to also include me, if I work with their PM?
Like so:
image

I was given a very neat dataview query that works, but would like it in dataviewjs format. I cannot replicate the file.outgoings.file.outgoings embedding in JS, and was hoping someone could lend me a hand?

TABLE WITHOUT ID file.link AS "Related People", team AS "Teams", Position AS "Position"
WHERE type = "person"
WHERE contains(file.outlinks, this.file.link) OR (contains(file.outlinks.file.outlinks, this.file.link) AND Position = "PDS")

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.