Delete record

Learn how to use the delete record operation on your table by using a opt-out flow example.

Deleting a record on your table means that you will delete a row on your table.

This means that you'll go from this:

nameemail_address is_susbcribed

Agatha

agatha@test.com

TRUE

To that:

nameemail_addressis_susbcribed

To delete a record from your table:

  1. Make sure that you already have a filled a table. For this example, we will use an opt in/opt out table that captures:

    • name: Captures customer's name.

    • email_address: Store customer's email address.

    • is_subscribed: Store customer's consent to be subscribed to a campain.

An example of table for Opt in/opt out.
  1. Make sure that you capture the relevant variables in your conversation. In our example, we capture {userName} in Collect input blocks. This is the variable that we will use as a filter to target certain row to be deleted.

  2. Add a Table operation to your flow.

  3. Select Delete record.

  4. Select the table that you'd like to work on. For this example, we called our table Subscriptions.

  5. Click on + Add filter to define a selection criteria. For this example, we filter out by looking at the 'name' column. If the name equals {userName}, it means that the row will be deleted once the opt out flow is triggered.

Delete a record from your Table.
  1. Click Save.

  2. Add a Message block as a Go to to let your customer know that they are successfully opted out.

Example of opt out flow.
  1. It's crucial to check the functionality of your Delete record operation to ensure that the correct row is deleted. Test your bot in the emulator. Run through your bot flow within the emulator to simulate the user experience and trigger the Delete record action.

Test your flow.
  1. Open your table, and verify that the bot deleted the correct row.

Check that the bot deleted the correct flow.

Looking for a quick and easy bot template to play with Tables? The Gym bot is a representative use case.

Last updated