I have 2 lists where I want to match 2 multivalue columns, List1 contains maintenance data (more companies could be affected so company contains several ids. Company is selected from a companylist btw. List2 is a list with a person and the companies he wants to be informed of when maintenance takes place.
For a single value this works with a Filter Array: "@or(contains(item()?['Comp#ID'], variables('ID')),contains(item()?['Comp#ID'],119))"
My idea was to create a string from the array of companies the user is interested in
- add a string to an array 'contains(item()?['Comp#ID'], @{items('EachComp')})
- then join that array with a ','
- in a compose (composeFilter) create the filter
@or(contains(item()?['Comp#ID'], 39),contains(item()?['Comp#ID'], 27),contains(item()?['Comp#ID'], 28),contains(item()?['Comp#ID'], 43),contains(item()?['Comp#ID'], 119))
and use that in the filter with the statement @outputs('composeFilter')
the result is
InvalidTemplate. The execution of template action 'Filter_Companies' failed: The result '@or(contains(item()?['Comp#ID'], 39),contains(item()?['Comp#ID'], 27),contains(item()?['Comp#ID'], 28),contains(item()?['Comp#ID'], 43),contains(item()?['Comp#ID'], 119))' of the evaluation of 'query' action 'where' expression '@outputs('composeFilter')' is not a valid boolean value.
If I insert this string as the filter to test it the flow runs without error.
Is it possible to create a dynamic filter in this way?
Or is there a simpler way to achieve this?