[Tip of the Week] Delete all Table Records using a Bot

hello,

in this week’s Tip of the Week, I’d like to share how you can delete all Records from a Tulip Table using the Table API.

warning: this deletes all Records from a Table, please use caution

there are three main steps to achieving this: 1. create a Bot in your instance, 2. build a Connector, 3. write the Connector Function.

  1. navigate to https://{{instance_name}}.tulip.co/account-settings/bots (please note you need to be an Account Owner to open this page). once you’ve accessed this page, click Create Bot that can be found at the top right:


    give the Bot a Name and enable the tables:write Scope:

    note: leave the tab open so you can copy/paste the API Key and Secret:

  2. create a new Connector Function and enter the details as follows (replacing the URL with your instance URL):


    open the Headers section and paste the credentials from the Bot you just created. please note that the Username is the API Key and the Password is the Secret:

  3. build a Connector Function with 1 input named tableID, DELETE as the method, and the following endpoint: /api/v3/tables/$tableID/records. as you see below the tableID in the URL will turn gray to confirm its been mapped to the Input:

once you enter a Table ID (found in the URL when you open a Table) in the Input and click Test (top right), you can Delete all the Table Records. and that’s it, you’re now ready to empty your Tables with just the click of a button!! again, please use caution as this deletes all records from your Table.

have people used this already?? if so, share why and when you use it.