New in JS + Transformer in Retool
- I need to filter my query.data by the values of three components on my canvas.
- Instead of using the WHERE clause in SQL, I would like to do the filtering in the Transformer
- What should the JS syntax in the Transformer be for the following criteria
SELECT * FROM table WHERE
customer_name like {{’%’ + customer_input.value + ‘%’}}
AND booking_id LIKE {{booking_input.value + ‘%’}}
AND booking_status IN UNNEST({{status_check_group.value}})
I am thinking something like
const data = {{query.data}}
return data.filter(some syntax that data.customer_name like {{’%’ + customer_input.value + ‘%’}}…etc)
Thanks for helping.