Delete record
Learn how to use the delete record operation on your table by using a opt-out flow example.
Last updated
Learn how to use the delete record operation on your table by using a opt-out flow example.
Last updated
Deleting a record on your table means that you will delete a row on your table.
This means that you'll go from this:
name | email_address | is_susbcribed |
---|---|---|
Agatha | agatha@test.com | TRUE |
To that:
name | email_address | is_susbcribed |
---|---|---|
To delete a record from your table:
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.
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.
Add a Table operation to your flow.
Select Delete record.
Select the table that you'd like to work on. For this example, we called our table Subscriptions.
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.
Click Save.
Add a Message block as a Go to to let your customer know that they are successfully opted out.
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.
Open your table, and verify that the bot deleted the correct row.
Looking for a quick and easy bot template to play with Tables? The Gym bot is a representative use case.