SOLVED

Preventing double booking of cars in a SharePoint calendar?

%3CLINGO-SUB%20id%3D%22lingo-sub-391802%22%20slang%3D%22en-US%22%3EPreventing%20double%20booking%20of%20cars%20in%20a%20SharePoint%20calendar%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-391802%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20trying%20to%20setup%20a%20simple%20car%20booking%20site%20using%20SharePoint%20Online.%20Currently%2C%20I%20have%20a%20list%20library%20called%20'Cars'%2C%20which%20stores%20a%20list%20of%20all%20the%20company%20cars%2C%20and%20a%20calendar%20called%20'Car%20Bookings'%2C%20which%20displays%20what%20cars%20are%20booked%20for%20a%20given%20day.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet's%20say%20on%20April%201st%20I%20add%20an%20event%20to%20my%20calendar%20(i.e.%20a%20car%20booking)%20and%20select%20'Nissan'%20from%20the%20lookup%20field%20which%20links%20to%20my%20list%20library%20of%20cars.%20The%20Nissan%20is%20now%20booked%20and%20logged%20in%20the%20calendar%20for%20April%201st.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20add%20another%20event%20item%20(car%20booking)%20to%20April%201st%2C%20it%20still%20allows%20me%20to%20choose%20'Nissan'%20from%20the%20list%2C%20despite%20it%20already%20being%20booked.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20any%20way%20so%20that%20when%20you're%20selecting%20the%20car%2C%20it%20removes%20the%20option%20to%20pick%20a%20car%20if%20it's%20already%20booked%20for%20the%20chosen%20date%2Ftime%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESorry%20if%20this%20seems%20complicated%2C%20I'm%20not%20sure%20how%20else%20to%20explain%20it.%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-391802%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-391884%22%20slang%3D%22en-US%22%3ERe%3A%20Preventing%20double%20booking%20of%20cars%20in%20a%20SharePoint%20calendar%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-391884%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F190211%22%20target%3D%22_blank%22%3E%40Toby%20McDaid%3C%2FA%3E%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1096%22%20target%3D%22_blank%22%3E%40Dean%20Gross%3C%2FA%3E%26nbsp%3Bis%20right--what%20you%20want%20to%20achieve%20is%20not%20a%20trivial%20function%20in%20SharePoint%20and%20you%20will%20need%20a%20Flow%20to%20manage%20it.%20If%20you%20want%20to%20recognize%20something%20as%20booked%2C%20that%20would%20also%20mean%20you'd%20have%20to%20take%20steps%20to%20mark%20it%20as%20available.%20What%20you%20want%20is%20achievable%2C%20though%20it%20will%20require%20some%20tinkering%20with%20Flow%20and%20probably%20another%20List%20or%20two%20to%20get%20it%20right.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-391821%22%20slang%3D%22en-US%22%3ERe%3A%20Preventing%20double%20booking%20of%20cars%20in%20a%20SharePoint%20calendar%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-391821%22%20slang%3D%22en-US%22%3EYou%20are%20going%20to%20have%20to%20create%20some%20logic%20to%20reset%20the%20IsBooked%20value%20when%20the%20car%20is%20no%20longer%20booked.%20You%20may%20also%20want%20to%20add%20a%20Duration%20field%20to%20handle%20bookings%20for%20more%20than%20one%20day.%20You%20can%20do%20all%20of%20this%20with%20some%20Microsoft%20Flows%20that%20run%20and%20reset%20the%20field%20values.%20It%20is%20going%20to%20become%20a%20little%20bit%20more%20complicated%20than%20you%20originally%20envisioned%20%3A)%3C%2Fimg%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-391813%22%20slang%3D%22en-US%22%3ERe%3A%20Preventing%20double%20booking%20of%20cars%20in%20a%20SharePoint%20calendar%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-391813%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1096%22%20target%3D%22_blank%22%3E%40Dean%20Gross%3C%2FA%3E%26nbsp%3BI%20think%20I%20would%20probably%20run%20into%20more%20issues.%20If%2C%20for%20example%2C%20I%20booked%20a%20car%20on%20April%201st%20and%20it%20sets%20IsBooked%20to%20true%2C%20it%20would%20then%20prevent%20me%20from%20making%20a%20booking%20of%20the%20same%20car%20for%2C%20say%2C%20April%2020th.%20It%20would%20also%20require%20manually%20resetting%20cars%20back%20to%20false%20once%20they've%20been%20used.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-391804%22%20slang%3D%22en-US%22%3ERe%3A%20Preventing%20double%20booking%20of%20cars%20in%20a%20SharePoint%20calendar%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-391804%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F190211%22%20target%3D%22_blank%22%3E%40Toby%20McDaid%3C%2FA%3EHow%20does%20the%20system%20know%20that%20the%20car%20is%20booked%3F%20You%20need%20to%20have%20something%20like%20an%20IsBooked%20field%20that%20gets%20set%20to%20true%20when%20it%20is%20booked%20and%20then%20have%20some%20logic%20to%20evaluate%20this%20setting.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1223974%22%20slang%3D%22en-US%22%3ERe%3A%20Preventing%20double%20booking%20of%20cars%20in%20a%20SharePoint%20calendar%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1223974%22%20slang%3D%22en-US%22%3E%3CP%3EDid%20you%20ever%20find%20a%20solution%20for%20this%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F190211%22%20target%3D%22_blank%22%3E%40Toby%20McDaid%3C%2FA%3E%26nbsp%3B%3F%3C%2FP%3E%3CP%3EI'm%20investigating%20a%20car%20booking%20solution%20and%20would%20like%20to%20know%20if%20you%20found%20a%20good%20solution.%26nbsp%3B%20I'm%20thinking%20I%20might%20need%20to%20do%20a%20PowerApp.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

I'm trying to setup a simple car booking site using SharePoint Online. Currently, I have a list library called 'Cars', which stores a list of all the company cars, and a calendar called 'Car Bookings', which displays what cars are booked for a given day.

 

Let's say on April 1st I add an event to my calendar (i.e. a car booking) and select 'Nissan' from the lookup field which links to my list library of cars. The Nissan is now booked and logged in the calendar for April 1st. 

 

If I add another event item (car booking) to April 1st, it still allows me to choose 'Nissan' from the list, despite it already being booked.

 

Is there any way so that when you're selecting the car, it removes the option to pick a car if it's already booked for the chosen date/time?

 

Sorry if this seems complicated, I'm not sure how else to explain it.

Thanks!

 

 

5 Replies
Highlighted

@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.

Highlighted

@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.

Highlighted
Best Response confirmed by Juan Carlos González Martín (MVP)
Solution
You 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 :)
Highlighted

@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.

Highlighted

Did you ever find a solution for this @Toby McDaid ?

I'm investigating a car booking solution and would like to know if you found a good solution.  I'm thinking I might need to do a PowerApp.