How to insert data to an existing Retool table using REST API?

  • Goal: I have an external application that generates JSON data as output to a web hook. I want to store that data into a Retook database table.

  • Steps: I am new to retool but I could not find anyway to insert data into a retool database table using an API. I was looking for a REST API that lets me insert data into the Postgresql Retool database. I saw some utilities to create mock data but I am not creating mock data. I need an API on top of my existing database to insert data from external system. Any pointers welcome.

3 Likes

Hello @Tracy_Samuel , Welcome to Retool Community.

Retool doesn’t directly provide an API for interacting with your database. However, you can set up a custom REST API or use Retool's internal queries and webhook triggers to achieve the goal.

Use Retool Workflows

If you’re using Retool Workflows:

  1. Create a Workflow:
  • Go to the Retool Workflows section and create a new workflow.
  • Add a trigger to receive webhook data.
  • Add a PostgreSQL step to insert the data using an SQL query.
  1. Configure the Webhook URL:
  • Use the Webhook trigger's URL in your external application.
  1. Map Data Dynamically:
  • Parse the webhook JSON payload and map the fields to the database columns.
4 Likes