How to set limit on votes?

I have a site where users have 2 options to vote on, and i want to make it possible to limit how many times the options can be voted. Shortly explained: i want to monetize it by making it possible to buy the possibility to get 5, 10 or 20 votes, but i cant figure out how to limit the voting. I have tried my hand at custom states, but cant make it work,
Please help

Hi there, @cvnfortnite… you definitely don’t want custom states on this one. One way you could go is when a user buys votes, store the number of votes they bought in a field (number) on the User data type. Then, when a user votes on something, subtract 1 from the number of votes they have left, and when the number reaches 0, do something to make it so they can’t vote until they buy more votes.

Hope this helps.

Best…
Mike

1 Like

Hey, thank you for the response
English isnt my mother tongue, so my explanation maybe wasnt the best.
When a user buys votes, they buy the number of votes they can receive from other users. The users that vote do not pay to vote, if that makes sense?

So basically what i need to figure out is how to limit the number of votes that can be made in total for each thing. I have two groups that works as the “votes”, where users can press them to vote.

I’m not really following you here, but I’m not sure it matters. If the user is buying the number of votes they can receive, you can still use the field I suggested, but subtract 1 from the field’s value every time a user gets a vote. When the number reaches 0, don’t allow the user to receive any more votes.

Okay i think i understand. Another question if you dont mind. As i have two possible options for voting, each of these include a comment section. I have figured out how to display two different comments in the repeating group, but i want to include the users(who comments) occupation and age, but each time one is voted, the occupation and age show up in both repeating groups. Any idea how i can limit the data to show up where the voting happens?

Hey again,
I’m having trouble subtracting 1 from the number of votes left, and “do something” so they cant make more than 5 votes. Do you have a more specific idea on how to solve?

i fucking cracked it, thank you so much for your input, it really helped!!

1 Like