Invalid input syntax for type json with jsonb column

I am currently experiencing an issue with a PostgreSQL query in my Retool application. I am trying to insert a JSON object into a jsonb column in my PostgreSQL database, but I am consistently receiving an "invalid input syntax for type json" error.

Here is the query I am attempting to execute:

Here is my error:

I'm pretty sure it's in the right format as a JSON, and whenever I remove the location column in retool and try to submit the query it works just fine so I've isolated it to this line. Any help is appreciated!

What result do you get if you run JSON.parse(yourObject) in the console? I believe it’ll be expecting a string there instead of an object.

The best way IMO to ensure proper JSON formatting here is to build it as a JS object and then use JSON.stringify(yourJsObject) when you go to insert it.