Hello. I cannot seem to get this query to work.
I am using multiselectListbox1 as a way to filter results in listView3. Basically a way to filter FAQs with tags. I can get the query below to work perfectly fine as long as there is an item selected in multiselectListbox1 but it returns no results if nothing is selected. I've tried different methods of conditions and using my full array of tags {{ resources_tags.data.Tag }} as an alternative search with no success. If I use an OR expression and i get the empty array error from the empty multiselectListbox. Any ideas?
WHERE
EXISTS (
SELECT 1
FROM UNNEST(Tags) AS tag
WHERE tag IN UNNEST({{ multiselectListbox1.value }})
Example of how I want it to work but getting empty array error:
WHERE
EXISTS (
SELECT 1
FROM UNNEST(Tags) AS tag
WHERE tag IN UNNEST(
CASE
WHEN ARRAY_LENGTH({{ multiselectListbox1.value }}) = 0
THEN {{ resources_tags.data.Tag }}
ELSE {{ multiselectListbox1.value }}
END
)
)