I created a Retool database to use for my data. I then created a workflow that queries the Intercom API, does some transformations and on the final step should write to the Retool database. But I keep running into errors. I checked the settings for the database and tried to change it to write but it appears I cannot either. What are my options?
The last step in my workflow looks like this:
INSERT INTO aggregated_metrics (team_name, total_conversations, closed_conversations, median_response_time, last_updated)
VALUES {{ code1.map(metric => ( '${metric.teamName.replace(/'/g, "''")}', -- Escape single quotes in team names ${metric.totalConversations}, ${metric.closedConversations}, ${metric.medianFirstResponseTime || 'NULL'}, -- Handle null values NOW() )
).join(", ") }}
ON CONFLICT (team_name) DO UPDATE
SET
total_conversations = EXCLUDED.total_conversations,
closed_conversations = EXCLUDED.closed_conversations,
median_response_time = EXCLUDED.median_response_time,
last_updated = EXCLUDED.last_updated;