cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SectorOMEGA
Helper V
Helper V

Event counter control

Im building a simple app to handle event registration forms in SP list. I have 4 events with two dates for each. Im looking for an option to add counter for each event occurrence as I need to limit attendees to 12 per session. Once the limit of 12 is reached I will disable the button for selecting the corresponding date. Is this achievable? Thank you in advance for your help 

19 REPLIES 19

@WarrenBelz After digging and reading around I have finally made it working. For Date1 Button Text Im using the date when the event will happen. For the Date in all code below only this works for me:

EventDate = DateValue("06/20/2021")

After that I'm Passing the text of Date1 Button to my Registration Form Date Card using this code for Default Date:

DateValue(Button4_4.Text)

Finally Your code come in hand like this for the Display Mode:

If(
   CountRows(
      Filter(
         'SPList',
         EventDate = DateValue("06/20/2021"))
   )>12,
   DisplayMode.Disabled,
   DisplayMode.Edit
)

Honestly I dont know how 'correct' is this approach but its working. Willing to hear your opinion 🙂

Hi @SectorOMEGA ,

For your second formula try this

CountIf(
   'SPList', 
   EventDate = DateValue("06/20/2021")
)

You are using a different process to what I envisaged (I would simply test the data at the point of potential submission)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@WarrenBelz Will try this also. As far as the process, a little bit different than yours, yes. However Im trying to understand something from your process. I have 4 event, each with 2 Dates. How will you implement those for end user submission? Thank you in advance

@SectorOMEGA ,

I would simply test each one with the structure I provided as soon as the user enters the two pieces of information, but having said that, I cannot see your model or the flow of logic you are implementing. If you have it working, then leave it alone (if it is not broken, don't fix it)

Maybe I forgot to to explain something my fault. I want users to have limited fields to enter and in order to do it, Im hardcoding the event date and event name. Form our AD Im taking their names, gender, manager etc. Excuse me for not mentioning this in the beginning 

Hi @SectorOMEGA ,

I am a little confused now - what do the users enter that you have to test?

My bad as I didn'texplained it well. End users will will fill out a few simple question and tabs that Im not able to grab from our AD. In order to limit the subscriptions for each event I have used your suggestion and it worked beautiful. However in order to create simple view of all 4 events at a glance I made this:EventPreview.PNG

 In the submission form I have EventDate card and EventTitle card.

For the DefaultDate of the EeventDate card which the Topic Label Im using this:

DateValue('Date 1 Button'.Text)

 For the DefaultEvent of the EventTitle Im using this:

Topic1.Text

  And this is the most that I can do in order to achieve it. However there is a draw back for this hardcoding as I will have to create 8 submission forms as I dont know if there is an option in powerpapps to detect which of all 8 date buttons will be pushed and apply the correct date

Thanks @SectorOMEGA ,

You can set a Variable on the OnSelect of each button

Set(gbl1,true)

and then test for the variable to see which one was pushed.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@WarrenBelz Ahh now you got my interest here. Sorry for the late reply but was on small vacation. Im trying to understand the above and trying to look over the internet how to exactly set it up

Hi @SectorOMEGA ,

Create value for a Variable on each button OnSelect

Set(gblButton,1)

and so on for the rest. The value of gblButton (it will be numeric) will be the number of the button last pressed.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,698)