Checkbox from SQL, how to format the array?

Goal: I would like to fill the checkbox component with a boolean array from a postgres DB.

SELECT 
    c.basic_name
    c.bookkeeping_service,
    c.cis_service,
    c.client_onboarding,

FROM 
    clients c
WHERE 
    c.id = 3;

if my query is called get_service_flags - i want to put in something like
{{ get_service_flags.data[0] }} in value or label? Bit lost. I'm brand new.

Thanks
Lucy

And the SQL works fine, returning value and boolean. Just not sure how to map it to my dynamic checkboxes.

Hello @ljv Welcome to the Retool Community,

You can use the values as true or false. If the value is true, the checkbox will be checked.

6 Likes