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