Have you already checked out the SQL Cheatsheet? Dealing with arrays in Retool largely depends on the type of SQL resource you're using. If you don't find the answer there could you let us know what that is?
I read that but I get this error Conversion failed when converting the nvarchar value '0,1,2,' to data type int.
the only way I can get it to work is by selecting each value manually.
AND (ISNULL(CONVERT(INT, COALESCE(Tag.TagId, 0)),0) IN ({{multiselectPhotoTags.value['0']}},{{multiselectPhotoTags.value['1']}}, {{multiselectPhotoTags.value['2']}}, {{multiselectPhotoTags.value['3']}}, {{multiselectPhotoTags.value['4']}}, {{multiselectPhotoTags.value['5']}}, {{multiselectPhotoTags.value['6']}}, {{multiselectPhotoTags.value['7']}}, {{multiselectPhotoTags.value['6']}}, {{multiselectPhotoTags.value['13']}}, {{multiselectPhotoTags.value['14']}}, {{multiselectPhotoTags.value['15']}} ))
I see, JavaScript has it's own nullish coalescing operator - ??. You might try mapping over your array with that or the logical OR operator - || in order to have your undefined values default to 0. Something like {{ multiselectPhotoTags.value.map(value => value || 0) }}. Does that work?