Dataview query with inline fields and several

What I am trying to do:

I want to link from people to projects, and use a dataview to show all people in a given project.

For this, I have inline fields for people who are involved in projects.

This looks like this:

[role:: Project manager]
[company:: ACME Corp]
[email:: [email protected]]
[project:: [[Falling Piano]] , [[Falling Anvil]] ]

So we have a project manager who is part of the projects “Falling Piano” and “Falling Anvil”.

(Yes, the projects are links, as I would like to be able to jump tp projects from people.)

Now my query in the project page “Falling Piano.md” looks like this:

'''dataview
TABLE 
ID, project, company, email 
from #people 
where project = this.file.link
'''

What is the problem?

As soon as a person has more than one project link, this goes bust and does not show this intro.

Other things I tried

I tried hardcoding the info you find under this.file.link like this:

'''dataview
TABLE 
ID, project, company, email 
from #people 
where project = [[Falling Piano]]
'''

And I have tried using a seperate line for each project, like this:

[role:: Project manager]
[company:: ACME Corp]
[email:: [email protected]]
[project:: [[Falling Piano]] ]
[project:: [[Falling Anvil]] ]

To no avail.

Help?

Could you try using the contains() function which tries to match among multiple values?

where contains(project, this.file.link)

Edit: This and other helpful functions are mentioned in the docs.

I tried that to no avail, but might’ve produced some typo or two after all the frustrated efforts.

Will give it a go once more and report back.

OK, I tried this some more.

Using the contains method works when I have the projects in frontmatter, but not when inline.

you need to tell us how you put the values in your inline fields

I thought I did in the initial post:

[role:: Project manager]
[company:: ACME Corp]
[email:: [email protected]]
[project:: [[Falling Piano]] ]
[project:: [[Falling Anvil]] ]

if there is anything missing, let me know.

I have tried it with links (what I really need) and also just plain text.
This does not change anything.

When I use the same data (different form, of course) in frontmatter, like this:

role: Project manager
company: ACME Corp
email: [email protected]
project: [[Falling Piano]] 
project: [[Falling Anvil]]

It works.
It also works if there is only ONE entry in the inline fields, as soon as there is more than one, it breaks.

Edit:
I tried the other inline version as well:

role:: Project manager
company:: ACME Corp
email:: [email protected]
project:: [[Falling Piano]] 
project:: [[Falling Anvil]]

No success.

I am happy to say that it works now… but I can not pinpoint what led to the solution.

It did not work one moment, worked the other, same code.
Only thing I did is that I visited both linked pages FROM the person entry.

There is one old reddit post with the same phenomenon:

:person_shrugging:t2:

1 Like

Have the same problem.

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