I am using Retool.com as my platform for building the application, but I am not sure how to proceed. I am trying to build a query but with not success. I would really appreciate it if anyone who has experience with Retool and PostgreSQL could give me some guidance on how to insert this JSON data into the database. Any suggestions or examples would be greatly appreciated.
@Dimitar_Terziev Welcome to the forumn!
There are many ways to implement this but the basic way is the following:
Use a javascript query to iterate over your result set (I used a transformer but in your case I would imagine the above array is the result of a query so below you would replace what I labeled as "parts" to yourquery.data:
query53 looks like: insert into parts(part_number,rid,status,type) VALUES ({{part_number}},{{rid}},{{status}},{{type}})
(Note that my table "parts" contains the following columns part_number,rid,status,type
When you run the js query it calls the sql to iterate over the array and insert each array value...
Thank you Scott for your help, you were extremely helpful in resolving my issue. I really appreciate the time and effort you took to assist me. Thanks again!