How do I use a JS array from a SQL query result in a second query's WHERE IN clause?

I have a working SQL query Cases and want to use part of that query result (an array of integers) in a WHERE IN clause in a subsequent query. I've tried manipulating the JS array into different forms with JSON.stringify(), join() etc. but I'm not having any luck.

Here's what I have:

I realise this is probably very straightforward but for whatever reason the solution escapes me!

Thanks in advance :smile:

1 Like

Try doing {{formatDataAsArray(}}

Thank you for the suggestion, but no joy. I think that's really to transform columnar SQL query results into arrays. is already an array.

OK didn't know - have you tried using = ANY({{}}) instead of IN


We're in business! Thank you, I never thought to try ANY