I want use powerapps to development a vote system .
I will let my user to chose which period they can to do something , but each period has limit ,maybe 20 people . When the click time reach the limit , the item will become “gray “ and user can not chose it.
So how can I finish my job or someone can tell me it has reference paper , thank you very much !!!
YUP!!
Finally , I finish this job today , in your method it can limit the click amount in this app
Thank you very much~
Thank you very much , maybe next monday I will try it
Now I have a template to reference , YES!!!!
Hi @JACK_LAI_1117 :
I think this problem should start from two aspects: data source construction and app construction.
I assume there are two events for the user to choose: "event1" and "event2".
I assume that a user can only select one event at a time, and an event cannot be selected multiple times.
I'v made a test for your reference:
1\My data source(TheList-SharePointList):
Column (click to edit) Type
2\Add two buttons(Event1/Event2)
Event1
OnSelect
Patch(TheList,{Title:Text(Now()),DisplayName:User().FullName,Event:"Event1"})
DisplayMode
If(User().FullName in TheList.DisplayName || CountRows(Filter(TheList,Event="Event1"))>=20,Disabled,Edit)
Event2
OnSelect
Patch(TheList,{Title:Text(Now()),DisplayName:User().FullName,Event:"Event2"})
DisplayMode
If(User().FullName in TheList.DisplayName || CountRows(Filter(TheList,Event="Event2"))>=20,Disabled,Edit)
Best Regards,
Bof
Same idea applies here...
Use this code in the OnSelect property of the vote button to increase the vote count.
Set(varPatchRecord, LookUp(your_datasource_name, ID=ThisItem.ID));
Patch(your_datasource_name, varPatchRecord, {NumberOfPeople: varPatchRecord.NumberOfPeople + 1});
Put this code in the DisplayMode property of the vote button. It will disable voting after 20 people have voted.
If(ThisItem.NumberOfPeople >= 20, DisplayMode.Disabled, DisplayMode.Edit)
My example assumes the vote button is inside a gallery or a form and there is a datasource with a column called NumberOfPeople storing the votes total.
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
NO , I mean 20 person , because my meeting room has it's capacity , so in order to prevent too many person chose the same time , son I need to set up this condition ~~~
@JACK_LAI_1117
20 people is not a unit of measure for time. I will assume you meant to say: 20 minutes.
Put this code in the DisplayMode property of the vote button. It will disable voting after 20 minutes
If(Now() > DateAdd(ThisItem.Created, 20, Minutes), DisplayMode.Disabled, DisplayMode.Edit)
I assume the vote button is inside of a Form. Therefore I used the ThisItem operator.
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2