Simple method to quantify +/- feedback

I wanted to use thumbs up / down to offer users a simple response to statements, which I could then quantify as a score (each thumbs up is +1, thumbs down -1). Quite simplistic, but tricky because to toggle the state of an icon you usually use a yes/no and create a workflow to set the state as ‘is no’ for each click. This is fine but yes and no are not numbers, so it was problematic when time came to update the score. I figured out a solution:

Instead I used a number state on the icons, and created a workflow like below:

( Arbitrary text:converted to number - (the state’s current number ← modulo → 2 ) * Arbitrary text:converted to number

For the thumbs up you use 1 for both arbitrary texts, for thumbs down you use 1 for the first and -1 for the second. This then cycles the thumbs up between 0 and 1, and the thumbs down between 0 and -1, and you can simply add this to the current score as part of the next workflow.

I know it’s quite niche, but thought it might help someone - I couldn’t find this solution on the forum!

I’ll chip in with a method off the top of my head.

  1. I’d save the score in DB, within the record representing the entity being thumbed-up or down.
  2. Should I allow one vote per user, I’d create a new datatype to save every user thumb-up/down, with fields referring the user, the entity and the direction of the thumb, just because the entity could be liked by many users and each user could vote many entities. That way I’d know if the thumb-up/down icon should be highlighted.
  3. I’d just add/substract 1 to the count everytime the user votes.

You can just use 1 and 0 as the yes or no. Here is an example:

Editor: Forum Test App | Bubble Editor

Preview: https://testapp42wcleandb.bubbleapps.io/version-test/simple_method_to_quantify___-_feedback?debug_mode=true

Feels like anything else would be overly complicated. :man_shrugging: Just my thought though.