Show all data when a filter is not in use + Use arrays in queries

I was going through this article, but I noticed that there was a case that probably some people need help with, and is when you have a multiselect but want to show all data if no value is selected.

You can achieve this fairly easy, here is an example:

SELECT * FROM "location"
JOIN leads ON leads_test."Location ID" = "location"."location_id"
  ({{source_select.value == 0}}) -- This worked for me, not .length, but .value
  OR (leads_test."Source" = ANY ({{ source_select.value }})) -- Here you replace it for your multiselect

I hope that this helps in case you are smashing your head against the table :face_with_spiral_eyes: