I am making a GET API request, and the API body response is in the JSON object list.
I am trying to save each list into the Retool hosted Postgres database.
As I am trying to insert a record into the database, I am running into this error:
Can someone advise how I can iterate over each list items and dump it into the database?
The Retool hosted database already has the headers:
- "Full_Name"
- "Sub-Department"
- "Business_Title"
- "Work_Location"
- "Last_Name"
- "Preferred_First_Name"
- "Start_Date"
- "Manager"
- "Reason"
The API response looks something like this:
{
"Report_Entry": [
{
"Full_Name": "John Joe",
"Work_Email": "john@email.com",
"Sub-Department": "Engineering : Sup",
"Business_Title": "Support Engineer",
"Work_Location": "Amsterdam",
"Last_Name": "Doe",
"Personal_Email": "john.doe@gmail.com",
"Preferred_First_Name": "John",
"Start_Date": "2024-02-20",
"Manager": "Jimmy Jones",
"Reason": "New Hire"
},
{
"Full_Name": "Aaron Carter",
"Work_Email": "aaron@example.com",
"Sub-Department": "People : Recruiting",
"Business_Title": "Principal Recruiter",
"Work_Location": "Tokyo",
"Last_Name": "Carter",
"Personal_Email": "aaron.carter@gmail.com",
"Preferred_First_Name": "Aaron",
"Start_Date": "2024-02-05",
"Manager": "Joe Jones",
"Reason": "New Hire"
}
]
}