Dataview query using property and inlinefields

What I’m trying to do

Hello,

  1. I have a main note with these property below:

campo_di_ricerca_TAG: Tag_layer
lista_TAG: layer4


  1. Let’s say I have other notes that have this inline field below:
    Note1: Tag_layer:: layer4
    Note2: Tag_layer:: layer2
    Note3: Tag_layer:: layer1
    Note4: Tag_layer:: layer3

  2. I have this Dataview query:

TABLE Serie, this.campo_di_ricerca_TAG, this.lista_TAG

FROM #input AND "My Inputs"

WHERE contains(row[this.campo_di_ricerca_TAG],string([this.lista_TAG]))

WHERE file.name !="⚡ Query personalizzata"
LIMIT 15

This query work good.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
— Actually my current situation is this:

  1. I have a main note with these property below:

campo_di_ricerca_TAG: Tag_layer
lista_TAG:

  • #layer3
  • #layer2

  1. In truth in the other notes I have this inline field below:
    Note1: Tag_layer:: #layer4
    Note2: Tag_layer:: #layer2
    Note3: Tag_layer:: #layer1
    Note4: Tag_layer:: #layer3

  2. There are 2 problems:

    • I know that in the property the character “#” is not necessary, but I have a meta-bind code that populate i with “# tags”;
    • in the property “lista-TAG” in reality I have a LIST property and not a STRING property.

    Than the same Dataview query doesn’t work.

TABLE Serie, this.campo_di_ricerca_TAG, this.lista_TAG

FROM #input AND "My Inputs"

WHERE contains(row[this.campo_di_ricerca_TAG],string([this.lista_TAG]))

WHERE file.name !="⚡ Query personalizzata"
LIMIT 15

Things I have tried

I tried to change the WHERE command and the function CONTAINS but cannot have a good result.

Is there a way to modify the Dataview query code above to work correctly with my real situation ?

After trying, and trying, and trying, and trying, and trying, and trying, …
I finally managed to find the solution which I list below:

TABLE row[this.campo_di_ricerca_TAG] AS Campo_Ricerca
FROM #input AND !"Hidden"
WHERE any(this.lista_TAG, (tag) => contains(row[this.campo_di_ricerca_TAG], tag))

LIMIT 40

for those interested in a similar problem. :grinning:

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