Limit number of votes

Hi - I am using our upvote button template but I would like to limit the number of votes each person can cast. How can I do that?

1 Like

Hi @Charlotte_Fisher,

I tried to make an “enhanced” version of the voting template in a single table based on a voting limit.

Let me know if it helps.

Cheers.

7 Likes

That’s awesome thanks!

C

1 Like

Thanks @Federico_Stefanato! I built off your example and created a version of the voting table with buttons that only allow 3 votes per person. After 3 votes, the buttons won’t perform an action.

Sharing in case helpful to others.

2 Likes

Thanks, Sean. It works greatly!
Now I wonder if I can actually disable the button if the voting limit has been reached…

if you add a variation on the condition to the disable option:

[Voting table].Filter(Upvoters.Contains(User())).Count() >= [Vote Limit]

it does what you say want, but I guess this not what you had in mind when asking the question since it disables all the buttons and my guess is you only wanted to disable the buttons with the ‘like’ on it, right?

To disable a selection of the buttons, we should define the paramaters accordingly:

[Voting table].Filter(Upvoters.Contains(User())).Count() >= [Vote Limit] and thisRow.Upvoters.Contains(User()).Not()

Cheers, Christiaan

5 Likes

Thanks for the speedy response, Christiaan. I came to find the same alternative solution yesterday very late, haha.