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 / Need help in setting a...
Power Apps
Answered

Need help in setting a limit for reservations

(0) ShareShare
ReportReport
Posted on by 23

Hello everyone,

 

I would like to seek your help. I am building a reservation app for an office space. How do I set a limit (ex. only 10 people per day)? Here are the variables, and connectors I used.

 

1. First the user needs to select a date in the calendar. The variable I used for this is selectedDate.

2. After selecting a date, they need to select a start time and an end time. The variables I used for the two are startTime and endTime.

3. Captured data will then be stored in a Sharepoint list with the following columns (CheckInTime, CheckOutTime, CheckInTimeText, CheckOutTimeText, CheckinTimeNumber, CheckOutTimeNumber).

 

I don't need the users to select a certain seat as it is a free-sitting environment. I just want to ensure that when they select their desired date and time, it does not accept their booking anymore if the count for that selected date and time is already beyond 10 users. I'm sorry if this question has been asked before, I tried to search the forum but none of them suits my needs. I hope someone here can help me how to get around this query.

 

Thank you very much. I have attached some screenshots for reference.

 

 

SP-List.png
Select-Date.png
Select-Time.png
Categories:
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Patcanete23 ,

     

    Generally, when Patching new entries into SP list, the App need to check the booked seats during the selected date and time by counting if there are more than 10 records in the list.

     

    Firstly, you can generate another variable to save the selected date and time:

    Set(startDateTime, DateTimeValue(Concatenate(selectedDate, " ", startTime)));
    Set(endDateTime, DateTimeValue(Concatenate(selectedDate, " ", endTime)))

     

    Then OnSelect of submit button:

    If(
     CountRows(
     Filter(
     SPlist, 
     !(startDateTime >= CheckOutTime || endDateTime <= CheckInTime)
     )
     ) < 10, 
     Patch(
     SPlist, 
     Defaults(SPlist), 
     {...}
     ), 
     Notify(
     "No Seats availabel in selected duration", 
     NotificationType: Error
     )
    )

     

    Hope this helps.

     

    Best regards,

  • Patcanete23 Profile Picture
    23 on at

    Thank you Jeffer Ni. I will try the above solution and update you. Thanks again.

  • Patcanete23 Profile Picture
    23 on at

    Unfortunately, it did restrict my booking, I was able to book more than 10 bookings for a specific date and time.

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Patcanete23 ,

     

    I don't understand. Isn't that exactly what you're looking for?

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard