[SOLVED] Limit clicks from visitors (eg voting system)

Hi Bubblers! :wave:

I’m implementing a public voting system, with multiple items. I’d like visitors to be able to vote only once (once up :point_up_2:, once down :point_down:) for each item. Screenshot:


(This is in a repeating group, for those wondering).

I’ve been looking at conditionnality of the icons, workflows of the icons (currently Click >> Make Changes to Thing >> Current Cell’s [Vote] +1 or -1) and on the forum, but couldn’t get this to work.

  • I understand that visitors are treated as unlogged Users, so the User’s Unique ID is available to track them
  • I’m thinking of filtering by cookies (User’s Unique ID) or IP Address (via the Ipiphy plugin, (later on), if users are abusing the system by clearing their cookies)
  • I believe this functionnality could be reached using the database (tracking vote per item per user) but I’m hoping there’s a simpler solution than creating entries for each votes :thinking:

Any thoughts?
Thanks!

Do you want users to be able to change their votes?

As far as the tracking the user, your best bet would be requiring users to actually have to sign in to a registered account. Going by IP isn’t the best because than two people in the same network can’t both vote. Cookies are obviously bad because clearing your cookies bypasses it.

Also, this article may help you: https://blog.bubble.is/how-i-built-an-app-in-30-minutes-using-bubble-1b15725bd221 (specifically the part about the “users who voted on me” field.

Hi @muoch10 and thanks for the answer! Problem solved :slightly_smiling_face: :+1: (take this upvote)

I don’t need users to be able to change their votes.
Also, although I might add accounts in the future, the voting system needs to remain publicly alterable. However I agree on the disadvantages of both cookie and IP filtering. But my system doesn’t require to be bullet-proof.

Thanks for the article, too. I actually implemented the given solution, which is what I meant earlier by “using the database” (ie adding entries to track users’ votes).
For those interested, what you need in addition to your voting system (see workflow above) is:

  1. Add a “User” field to your Data Type (here “Items”). Make it multiple entries! (“This field is a list”)
  2. Add the tracking of the users to your workflow.

    Do this for both workflows (upvote and downvote).
  3. Add a condition to the trigger of your workflows:

What bothers me with this solution is that in the database, an item might have thousands (ok, maybe dozens) of users. That could mean a lot of data for one cell. I was hoping for something “simpler” but hey, I believe you need to track who voted a way or another.
Strangely enough, though, the given field remains empty after a few tests:

Note that the voting limitation is functionning, but it doesn’t display users (and so you can’t modify this to give another shot to vote to someone, if you wanted to).
Also, note that I allowed 1 vote per user (either up or down). If you wish both, you need to track up :point_up_2: and down :point_down: votes in 2 separate fields, and “user voted up” / “user voted down” :wink:

Best,
Luc

4 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.