# How to Prevent Overlapping bookings in a Podio Calendar

With a Calendar App, when a meeting Item is added, a previous item for that same date and time may already exist. This could be very problematic.

## Solution

Create a flow to check for overlapped bookings and send an alert to the **Item Creator** to reschedule the new meeting.

1. Add a **Podio** calculation field to the app to show just the date in format **YYYY-MM-DD**. We need this only to search on later.

   ![Overlapping Booking Sol](https://www.progress.com/podio/documentation/assets/6d4a10aa2c5c2a8c234185561c51216f/overlap_date1.png)

2. Build your flow on create of an item in the app:

   ```
   -  If date|start != ""
   -  AND If date|end != ""
   -  Create a custom variable for just the date: date("Y-m-d", strtotime( [date-token] ))
   -  Search in App where above new podio calc field equals above variable (ie find all other items for the same day)
   -  For each found item
   -  Sanity Check: ((strtotime([date-token|start])>=strtotime([found-date|start])) && (strtotime([date-token|end])<=strtotime([found-date|end]))) || ((strtotime([date-token|start])<strtotime([found-date|end])) && (strtotime([date-token|end])>=strtotime([found-date|end]))) || ((strtotime([date-token|end])>strtotime([found-date|start])) && (strtotime([date-token|end])<=strtotime([found-date|end])))
   -  add a comment or something
   ```

   Basically we're searching for all other items on that date, and then comparing the start and end times to see if they overlap.

   ![Overlapping Booking Sol](https://www.progress.com/podio/documentation/assets/11a3c3f049a2916f7041395e3efb4fb1/overlap_date1a.png)

   ![Overlapping Booking Sol](https://www.progress.com/podio/documentation/assets/6a5a1bfade2f70ac2cb390abb6b5e009/overlap_date1b.png)

## Result

A chat message will now be sent to the person in charge of the meeting to reschedule the event.

![Overlapping Booking Result](https://www.progress.com/podio/documentation/assets/f45f424e1bcb219258047f2ee271ec80/overlap_date_rslt1.png)
