cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rudi1011
New Member

URGENT DESK RESERVATION VARIABLE and IF FUNCTION

I have this desk reservation app and not sure how to restrict users to a single booking per day/single desk per day:

 

I basically need the code to check the sharepoint list for if there is a booking for the current day against the current user then no further bookings are allowed for that date. They will be allowed to make a booking for the future only then.

 

Current code:

 

If(IsBlank("Desk Reservations", Date(selectedDate) && Employee = currentUser.Title),Notify("You can only have one reservation per day"), Navigate(DeskSelect)

 

Thank you.

1 REPLY 1
BCLS776
Super User
Super User

Assuming Desk Reservations is the name of your list, try something more like:

If(
    LookUp('Desk Reservations', Date = selectedDate && Employee = currentUser.Title, true),
    Notify("You can only have one reservation per day"), 
    Navigate(DeskSelect)
)

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,459)