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 / Allowing only one book...
Power Apps
Answered

Allowing only one booking per day

(0) ShareShare
ReportReport
Posted on by 802

Hi, 

 

I have a deskbooking app which I am building. The user can select their desk from an interactive floor plan and this writes (patches) their booking to one of three Dataverse tables; these are split by location of the office they are booking for. 

 

I want to add some logic so that the user cannot book more than one desk per day across any of our offices (so across the three Dataverse tables). If they try to, I want an error message to display. I also want some specific users (I have their emails) to be able to book more than one desk per day, however.

 

Any ideas?

 

thanks

K.

Categories:
  • Verified answer
    zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Store the emails for specific people in separate database.

    App.OnStart

    Set(varUser,User());

    Set(IsEmail,LookUp(LIstWithEmail,Email=varUser.Email).Email);

    The above code will store logged in user's email into variable if he is in that specific people list.

     

    Wherever your "Submitting to databse" code is write this before that:

    Set(IsList1,LookUp(List1,Email=varUser.Email && BookingDate =Today());

    Set(IsList2,LookUp(List2,Email=varUser.Email && BookingDate =Today());

    Set(IsList3,LookUp(List3,Email=varUser.Email && BookingDate =Today());

     

    If( !IsBlank(IsEmail),

    Your Submit Code,

    If(!IsBlank(IsLIst1) || !IsBlank(IsLIst2) || !IsBlank(IsLIst3),

    Notify("You can only make one booking per day",NotificationType.Error),

    Your submit code);

     

    What the above code does is whenever user tries to make a booking it will first check all three tables weather same user has booking for the same day. If it is there it will store that value in the variable. If one of the variable has value stored in it. It will display error message. if not it will save that record. If you want to make booking procedure faster you can set this three variable on App.OnStart also

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 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard