Posted: 2015-01-23
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.
Create a flow to check for overlapped bookings and send an alert to the Item Creator to reschedule the new meeting.
First: Add a Podio calculation field to the app to show the just the date in format YYYY-MM-DD. We need this only to search on later.
Next: Build your flow on create of an item in the app:
date|start != ""
date|end != ""
date("Y-m-d", strtotime( [date-token] ))
((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])))
Basically we're searching for all other items on that date, and then comparing the start and end times to see if they overlap.
A chat message will now be sent to the person in charge of the meeting to reschedule the event.