Using (IN) with a list of values from a Retool component or state

If you have a Retool component or state that's returning an array of values and you want to use it in a SQL query:

delete from dbo.users
where id in(SELECT value FROM STRING_SPLIT({{ BulkDeleteRows.value }}, ','))

(from @bradlymathews)

1 Like

Hi @justin, this FAQ and cheatsheet contains all the variant on how to deal with arrays from different resource type. I use BigQuery often and UNNEST has been my friend since figuring it the hard way :laughing:

1 Like

@jocen true :slight_smile: