I want to process only those elements from an array whose key-value pair corresponds to a key-value pair from another array. But this doesn’t work as it should.
This is array 1, from which the containing elements are to be further processed:
[
{
"body": {
"content": [
{
...
"title": "Test 1",
...
},
...
{
...
"title": "Test 25",
...
}
]
}
}
]
This is Array 2, which specifies which elements from Array 1 are to be processed further (and only those where ‘title’ from Array 1 corresponds to the value of any ‘1’ from Array 2).
[
{
"array": [
{
"0": "1",
"1": "Test 2"
},
{
"0": "1",
"1": "Test 4"
},
{
"0": "1",
"1": "Test 6"
}
],
"__IMTAGGLENGTH__": 3
}
]
In this case, the elements Test 2, Test 4 and Test 9 from Array 1 should be processed further. However, the comparison does not work properly.
What have I done?
I have run an iterator over array 1 (from the LexOffice module), which splits the individual elements into bundles. The output looks like this:
[
{
...
"title": "Test 1",
...
},
{
...
"title": "Test 2",
...
},
"version": 6,
"__IMTINDEX__": 25,
"__IMTLENGTH__": 25
}
]
Previously, I generated Array 2 as described above from a Google Sheet and a subsequent ArrayAggregator.
I then activated a filter that looks like this.
And this is the wrong result:
The problem: It compares 25 times the value in the key ‘title’ of the first entry of array 1 (i.e. ‘Test 1’) with the value of ‘1’, again exclusively from the first entry of array 2. I can see this when I scroll over the variables that are compared with each other. What I would actually expect would be that it compares the ‘title’ in the first bundle with all 3 values from array 2 and passes it on accordingly or not, then the ‘title’ of bundle 2 with the 3 values from array 2 and the whole thing up to bundle 25, so that in the end 3 bundles pass the filter. What am I doing wrong?