Logo
For example "scheduled tasks"
Search
Info
Content
Category Navigation
  • 🎯  Solution Guides

  • Low Code Solutions

    Add "Tabs" to your app

    ID Target Link

    Use an address field to display a static street view thumbnail

    Turn your menu into a fixed menu

    Auto close mobile menu

    Display record information in a card

    How to add a back button to your app

    Add a collapsible accordion element to your app

    Code Snippets

    PHP Curl Create New Record

    PHP Get Records With Filters

    Google Scripts - Get record and create new records from connected table

    Save Tables and Fields into Spreadsheet

    Google Scripts - Export all records

    Webhook to save deleted records

    Send Messages to Slack

    Restrict Space and Force Uppercase in a Form

    Building Advanced Features

    Use Validation Rules to Ensure Unique Votes Per User

    Use Record Rules to Create an Audit Log

    Track current inventory with transactions

    Schedule Bookings and Prevent Double Bookings

    Create orders with multiple items and varying quantities

    2 Step Forms

    Unique Record Validation

    Restrict Editing Records to Record Owners

    Sum date/time field

    Duplicate Records

    Advanced App Customization

    How to embed a Tadabase page on another website

    Adding external fonts

    Custom Favicon

    Making apps mobile friendly

    Show date/time as a countdown

    Importing many images at once

    Adding QR Codes

    Adding charts to PDFs

    Customizing your app shortcut for mobile phones

    Animate parts of a page

    Design Customization

    Changing background colors

    Set background colors to the edge of a page

    Change the background of a column

    Add padding around a component

    Using an image as background for a page

    Adding a background image to a row, column, or component

  • Duplicate Connected Records

Categories
🎯 Solution Guides
Building Advanced Feat...
Schedule Bookings and ...

Schedule Bookings and Prevent Double Bookings

In this article we will go over how to set the ability to book appointments or reserve an item for a period of time while preventing double bookings. 

 

This setup involves the use of Validation Rules. If you are not familiar with Validation Rules please see our support doc titled Form Validation Rules.

 

Let's first layout the general structure we'll be building so you can have a better understanding of the process along the way. 

 

Say we have a car rental app. Users will go to the app in order to reserve a vehicle. We will display a calendar of all the previous bookings so users can see what the available times are. Then to make a booking, a user will select a vehicle and choose a start and end time. If the times selected conflicts with any previous bookings on the chosen vehicle, a custom message will be displayed preventing the booking from going through.

 

Now that we've described the structure behind the process, let's get started on actually building this all out: 

 

The First step is to go into the data builder and add two tables: Vehicles and Bookings.

 

XX6aQ9Q3LVQXGpENLT2ahNA9YrGTHqVaOQ.png

 

In the bookings table, we'll now add two fields: 

1. Add a "Date Range" field we can call "Booking Time" and select to enable "Start and End Date"

 

8xqhAxF89Ts4Rh8WLNJZDBiJGiSlqJxiFg.png

 

2. Add a "Connection" field we can call "Vehicle Name". Then make the connection to the Vehicles table.

 

ZP9QqTpR646cOHvwe0r7WVSQQdCD-THpLg.png

 

Before we move on to the page builder let's add some Vehicle records. In the Vehicles data table under the records tab, we can select to "Add New" record and enter some vehicle names.

 

 

Now let's move on to the page builder to design how we wish to display our vehicles and bookings.

 

In the page builder we can add a page with a Calendar component, select the Bookings data table and click to quick add. Then we can add a Form component, again selecting the Bookings data table and quick add.

 

-ChnXNn4Qf2lzLc0O5zUgoo1APlnhkURVw.png

 

 

Now that we have our components,  let's set Validation Rules to prevent bookings from being submitted if they conflict with previous bookings. To set validation rules, click on the Add Booking Form to edit it. Once inside the form, click on Form Rules and then Validation Rules. 

 

Once in Validation Rules, select Add New Rule, and then set a rule that if the "Date Range" field (which we have chosen to call "Booking Time") "conflicts with existing records" then display an error message preventing the form submission. This rule will work if we only have one vehicle or one item being reserved, but if we have multiple vehicles we will want to allow different vehicles to be booked for the same time.

 

APOEIhDwPHGfPE4n6XV1kd-cJm-MOzPWAg.png

 

To allow for different vehicles to be booked for the same time when we have multiple vehicles, select the plus icon to add a parameter to the rule to check that the "Connection" field (which we have chosen to call "Vehicle Name") "is not unique".

 

3jId2pSiPBFhm2hbA3fWz3Gvo0ITvINnJg.png

 

Now users can select which vehicle they would like to book and they will only be allowed to book the vehicle in the times it is available for.

 

HsbnT0fzzffLoNnFR27zETUJYzOndGtgpw.png

 

 

How did we do ?

Previous Article
Track current inventory with transactions
Next Article
Create orders with multiple items and varying quantities
Back to top
API
100% Operational
Apps
100% Operational
Builder
100% Operational
Overall Status
100% Operational