cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ChadVKealey
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...>});
Navigate(SuccessScreen,Screentransition.Fade)

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.

1 REPLY 1
Sofie_D
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'

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 22 members 4,251 guests
Please welcome our newest community members: