I need separate row in my table for each multiple checkbox (if selected)values in the form



case condition is not working in the insert query.

Hi @Jame,

You're missing the }} after {{affordableFloorPlanProgram.value[1] (on the line highlighted in red.

thanks..still having issue
image

Is it correct to add 'case condition' in between insert statement in retool?

it look like you want to write a query that includes the CASE and then to insert the results of the query. You are currently inserting values which should just be a list of values.

The form for a query insert should be something like:

INSERT INTO foo
SELECT 
  bar.buz,
  CASE 
    WHEN bar.buz = ‘cond1’ THEN 0
    ELSE bar.array
  END
FROM
  bar
WHERE
  bar.limit = ‘limiting criteria if needed’

Or you can use a ternary operator instead of the CASE when creating your list from variables: