Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

How to stop a user booking 2 appointment slots

(0) ShareShare
ReportReport
Posted on by

Hi, I hope someone can assist.

 

I have built an appointments booking PowerApp, which feeds from a SharePoint list. 

The user goes into the app, clicks the new button and then this will navigate to 'find an appointment' screen with a gallery of available appointments. 

On the new button I added the below, so if they already have an appointment booked, it does not allow them to book another and will take them to the 'Already Booked Screen', where they can see their current appointment on the gallery. 

 

If(CountRows(gal_bookings.AllItems) > 0, Navigate(AlreadyBookedScreen),

Navigate(FindAnAppointmentScreen));

 

However, when you first log into the app and click the 'new' button, even if the user already has an appointment booked, it still navigates to the 'find an appointment' screen. It's only when you go back, it then realizes that the user already has one booked and if you click new again, it would then navigate to the 'Already Booked Screen'.

 

I tried adding 'Refresh(SP List name)' but still experiencing the same issue. 

 

Does anyone have any suggestions please? 

 

  • Nogueira1306 Profile Picture
    Nogueira1306 7,390 on at
    Re: How to stop a user booking 2 appointment slots

    My suggestion if or you to do something like this:

    If(

    IsBlank(LookUp(YourDataSource; AppointmentUser.Email = User().Email));

    Navigate(FindAnAppointmentScreen);

    Navigate('Already Booked Screen')

    )

     

    So, do a LookUp in your datasource and the condition must be something related to the user (email, id, displayname, whatever you use in your datasource).

     

    Check if it is blank or not and based on that, navigate

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,

    Gonçalo Nogueira

    Check my LinkedIn!

    Buy me a coffee!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,304

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard