I use a select component with some values. When something is selected, by using myselect.selectedItem
will give me the Json output: {"planid":2, "planname": "family"}
I'm directly using this in my sql query as below.
UPDATE mytable SET
name = '{{new_name.value}}',
plan='{{myselect.selectedItem}}',
WHERE ID = 1
Here, when i hover over the sql query, its;
"UPDATE mytable SET
name = 'Cassandra',
plan='[object Object]',
WHERE ID = 1"
Here, plan
field is of type Json in the database (Postgres)
This now complains that: invalid input syntax for type json
.
Whats the fix here?
Thanks!