web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / SharePoint custom form...
Power Apps
Suggested Answer

SharePoint custom form - How to prevent double booking of a room (overlapping start/end)?

(0) ShareShare
ReportReport
Posted on by
Hi everyone,
I’m building a SharePoint custom list form in Power Apps for booking meeting rooms.
The list has:
Salka (Room) – Choice field
Start – Date/Time
End – Date/Time
 
I need to prevent overlapping reservations for the same room (e.g., if an existing booking has Start < NewEnd AND End > NewStart).
I tried adding validation in SharePointIntegration.OnSave and also in a custom button’s OnSelect, but I keep getting formula errors or the check doesn’t work reliably in the SharePoint form integration.
What is the recommended way to validate overlapping bookings in a SharePoint custom form (Power Apps)?
 
Should this be done in the form (Power Fx), or should I move the logic to Power Automate?
Any working formula examples for detecting overlaps in SharePoint list records would be greatly appreciated.
Thanks!
Categories:
I have the same question (0)
  • Suggested answer
    WarrenBelz Profile Picture
    155,840 Most Valuable Professional on at
    The best you can do (which will not catch absolutely "concurrent" writes) is to check the modifled date/time of the current record with that of the one of the Form the user has retreived. So put a Label in any Data Card on your Form (you can hide it) with
    ThisItem.Modified
    and do something like this
    If(
       Lookup(
          SPListName,
          ID  = SharePointIntegration.SelectedListItemID
       ).Modified <>
       DateTimeValue(YourLabelName.Text),
       Notify(
          "This reservation has been updated since you selected it. Please re-select to see changes",
          NotificationType.Error,
          5000
       ),
       SubmitForm(FormName)
    )
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  
     
     
  • WarrenBelz Profile Picture
    155,840 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for. Happy to assist further if not.
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn   

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard