Autogenerated form doesn't accept JSON field insertion in PostGreSQL

I have a retool app connected to a PostgreSQL database.

I auto-generated an add form for a table using the autogenerate feature.
The table has a JSON field called more_details however.
When I am trying to submit the form, I am getting the following error from PostgreSQL:

This is a screenshot of the query attached to the form:

I expected this to work out of the box but it doesn't. I assume this has something to do with escaping the quotes in the JSON, but shouldn't retool do that automatically. How would JSON field inserts work otherwise?

Can someone help? I don't want to write a transformer for every JSON field to escape the characters (in case that's the root cause)

Hi @Parth_Sharma

Thanks for reaching out! I saw internally that you were able to sort out the issue, as being related to having an empty JSON field :disappointed: Sorry this didn't work out of the box! I'd love hear exactly what changes you had to make or what could have made this easier, so that I can inform our product team.

1 Like