However my issue is, that the value of listbox1.selectedItem.id can sometimes be an empty string. In that case I want to use the Default row statement from the table instead.
Where are you using: {{ listbox1.selectedItem.id == '' ? DEFAULT : listbox1.selectedItem.id }} ?
In the query or a component?
Also, have you tried using CASE in the query?
Hey @Rupur! The default value set on the column in the DB will be used if there is no value for that column passed in the insert query. I think the root issue here is that you are always passing some value for the id column in the query which is then never using the default, and occasionally causing syntax errors due to data type mismatches. I'd use a JS query to determine which case the data currently satisfies and trigger an appropriate SQL query. My setup is different than yours, but the underlying structure should be the same.