Forum Discussion
Preventing double booking of cars in a SharePoint calendar?
- Apr 01, 2019You are going to have to create some logic to reset the IsBooked value when the car is no longer booked. You may also want to add a Duration field to handle bookings for more than one day. You can do all of this with some Microsoft Flows that run and reset the field values. It is going to become a little bit more complicated than you originally envisioned :)
Toby McDaidHow does the system know that the car is booked? You need to have something like an IsBooked field that gets set to true when it is booked and then have some logic to evaluate this setting.
- chelsey_anneOct 02, 2024Copper Contributor
I've just finished setting up our booking system.
Working with 3 lists and power automate.
List 1 is the full inventory with all vehicles and information relating to them. Using a powerflow based on the status in the field 'availability' it autopopulates list 2 available vehicles. I did originally have 1 list with a filtered view to available but they could still see all vehicles. Once the available vehicle list is populated there is a hyperlink column with custom json to create a button like clickable link labeled "request to book". This opens a booking request form.. This form is the front for list 3. Some slight modifications on the header, body and footer to make it look more like a form and user friendly. I wanted to use the new forms option within SP lists but I couldn't get it to autopopulate the registration on the booking request form. Once I had the lists set up I started working on the flows.
Flow triggers from the addition of item in the booking list. It then uses a filter query leading to get items to return anything that conflicts with any existing booking using the booking & return date the approval status and the registration if it finds any matching conflicts then it updates booking list to rejected and sends a notification to say there is a conflict and you need to check the booking calendar (this is the booking list in calendar view filtered to show only approved bookings by registration).
If there's no conflict it then goes through the approval process updates the lists based on either response and sends a notification with various details for the car etc for booking confirmation and rejection.
I'm pretty sure the flow could be better but I'm still quite new on power automate so any suggestions are welcome. Dean_Gross
- Rob_ElliottOct 03, 2024Silver Contributor
chelsey_anne I created our lease car booking system with a Power Apps front end, SharePoint lists as the backend and various flows in Power Automate. It was the same system as I had implenented for a desk booking system back in 202 which had over 25000 bookings.
On its own Lists and the SharePoint calendar cannot prevent clashes so the use of the Power Platform is necessary.
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)
- Toby McDaidApr 01, 2019Iron Contributor
Dean_Gross I think I would probably run into more issues. If, for example, I booked a car on April 1st and it sets IsBooked to true, it would then prevent me from making a booking of the same car for, say, April 20th. It would also require manually resetting cars back to false once they've been used.
- Matt CoatsApr 01, 2019Iron Contributor
Toby McDaid, Dean_Gross is right--what you want to achieve is not a trivial function in SharePoint and you will need a Flow to manage it. If you want to recognize something as booked, that would also mean you'd have to take steps to mark it as available. What you want is achievable, though it will require some tinkering with Flow and probably another List or two to get it right.
- Dean_GrossApr 01, 2019Silver ContributorYou are going to have to create some logic to reset the IsBooked value when the car is no longer booked. You may also want to add a Duration field to handle bookings for more than one day. You can do all of this with some Microsoft Flows that run and reset the field values. It is going to become a little bit more complicated than you originally envisioned :)