Showing results for 
Search instead for 
Did you mean: 
Level 8

Need some guidance on creating an event registration app

I'm working on an app for faculty to sign up for workshops. There is a list of workshops (in SharePoint) where each has a capacity and a count of current registrants. In the app, the list of workshops appears in a gallery with a "register" icon. If "capacity - registrants = 0", that icon is disabled, so once a session "fills up", nobody else can register for it. The problem is that that data is brought in when the user clicks a button to view a list of sessions. I know that I need to refresh that data when they click the "register" icon and then either register them (if space is still available) or tell them that they couldn't be registered because it filled up. What I'm unsure of is the best way to do this.


My first idea was to pull the selected session into a variable:

Set(var_SelectedSession,LookUp(Sessions, ID = ThisItem.ID)

Then, run the "seats available" calculation and set another variable:

If (var_SelectedSession.Capacity - var_SelectedSession.Attendees > 0, Set(var_SessionFull,false),Set(var_SessionFull,true)

And then use the "var_SessionFull" variable to control the action and message text:

If (var_SessionFull,Navigate(SessionFullScreen,Screentransition.Fade),Patch(Defaults(Attendees),{ <blah blah blah...>});

This kind of "race condition" is something that we often ran into with SP2010, so we came up with a way to handle it (mostly) through SPD workflows, but the only way to deliver that feedback to the user was through an email. I'd like to think that there's a better way to address it in PowerApps.

Level 8

Re: Need some guidance on creating an event registration app

I made a similar app a while ago and used the same approach you are explaining.

Just beware of a problem I encountered with this: if there is 1 spot left and 2 users register within a couple of seconds from each other it could still cause problems. So make sure you disable the register button with capacity - registrants < 1 instead of '= 0'