Column of all keys with value ==Value

What I’m trying to do

I have several files with dataview inline fields. minimal example is:

File1
some text with [link-type2::[[File3]]]
and [link-type1::[[File2]]]

File2
some text with [link-type2::[[File1]]]
and [link-type2::[[File3]]]

File3
only has [link-type1::[[File1]]]

etc.
In my case, I want to create a table that collects all backlinks and shows their type. In the more general case (where my key::values were not links but something else), I need to collect the fields that share a specific value, and display in a column what their key is.

For Example, I want to add a table to File2 that looks like

File Relation
File1 link-type1

(note no entry for File3, because it has no link to File2)
and in File3:

File Relation
File1 link-type2
File2 link-type2

Things I have tried

This is my current best result:

Table choice(contains(link-type1,this.file.link),"link-type1",choice(contains(link-type2,this.file.link),"link-type2","None")) As Relation
Where Relation != "None"

But it shows all the Nones anyway.
This approach is not a good answer anyway, because it hard-codes the possible keys and would be hard to maintain with more link-types.

Is there some sort of grouping approach to this?
Thank you

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