Retool Database and JavaScript Query Data

Hello,

I currently have a Retool Database Query that goes

SELECT * FROM driver WHERE name IN ({{driverSelectValues.data}})

The driverSelectValues is a JavaScript that goes

const selectedValues = multiselectListbox1.selectedLabels.map(value => `'${value}'`).join(',');

console.log(selectedValues)
return selectedValues;

Is there any reason why the query yields no result when it was supposed to?

I believe that you need to turn off prepared statements for retool db for this to work.

Is there any workaround without turning off prepared statements?

Hello!

I think this one way to get around the limitations of the IN clause:

There is an additional link to another post that goes into further detail.