Update record

Learn how to use the update record operation on your table by using a gym bot example.

Updating a record from your table means that an already-existing record is updated on one of several of its cells.

To exemplify this, we will use a gym booking bot that uses a Table to store who is booked in a yoga class. By updating record, we will add the user as enrolled to the class.

This means that you'll go from this:

classNameclassTeacherisBooked

Zumba

Monday

None

To this:

classNameclassTeacherisBooked

Zumba

Monday

Agatha

Update a record

  1. Make sure that you have a well-defined table. For this example, we'll use gym booking table with those fields:

    • ClassName: Name of the fitness class.

    • ClassDay: Date of the class, in a consistent format (e.g., YYYY-MM-DD).

    • ClassTime: Start time of the class, using a clear format (e.g., HH:MM AM/PM).

    • ClassTeacher: Name of the instructor leading the class.

    • IsBooked: Status field indicating whether the class is booked ('None' or 'Available' by default, updated to customer's name upon booking).

  1. In your bot flow, identify the point in the conversation where the customer chose a class and confirmed their booking.

  2. Add a Table operation to your flow.

  3. Choose Update Record from the list of operations.

  4. Select the table that you want to update. For this example, we'll select Gym class booking.

  1. Under Operation Config, under the isBooked column, add the variable holding the customer's name. In our example, this variable is called {userName}. This means that the isBooked column will be updated with {userName} as a new value.

  1. Under Define a selection criteria for the records to update, set the conditions to identify which record (or row on your table) should be updated. In our example, the conditions should match the class that the customer is booking. Therefore, we're going to check that {className}, {classDay}, {classTeacher}, and {classTime} are already specified.

  1. Click Save.

Test your flow

It's crucial to check the functionality of your Update record operation to ensure data is captured and stored correctly:

  1. Utilize the emulator to test the flow that you just build.

  1. After completing the booking process in the test, navigate to the updated table (in this example, it's called Gym class booking) to verify the update. Ensure the isBooked filled with the customers booking the selected class are updated as expected.


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

Last updated