Upvote / Downvote functionality

I am struggling with this upvote/downvote feature:
Supposedly, you gotta make two workflows for the same button. One that will ‘add current user to the voters list’, and another one that will ‘add 1 to the votes’.
The second workflow is just the opposite; it will remove the current user and subtract 1 from the voters list.
However it doesn’t work, it seems that as soon as it add the current user, nothing more happens.
Anyone can shed some light on this ?

Hello @michaelvrutaal

When clicking one button to achieve a functionality where the application detects that the object-entry is contained or not in a list of object-entries … you use two workflows:

  • the first one detects if the entry is contained in the list
  • the second one detects if the entry is not contained in the list

Again … remember that we are using ONE button to achieve one of two results:

  • add an entry to a list of entries if the entry is not contained in the list
  • substract an entry from the list of entries if the entry is contained in the list

Considering the above please review the following:

When clicking a button when the entry is not contained in the list this is the logic needed:

  • a condition on the click of the button where the list of entries contains the entry
  • an action that substracts the entry from the list through this expression: list of entries minus :item entry

Alternatively, when clicking a button when the entry is contained in the list this is the logic needed:

  • a condition on the click of the button where the list of entries does not contain the entry
  • an action that adds the entry to the list through this expression: list of entries plus :item entry

Hope the above makes sense and helps :smiley:

Hello cmarchan,

I understand what you are saying, and it is precisely what I have. However, it seems that once I UpVote, I am not able to DownVote anymore.

See the screenshots of the 2 workflows on the same button.

The logic I laid out assumes that you would not want to.

Think through how to set up the logic to achieve what you need.

What condition or conditions are required to enable what you need. And once that happens … what should happen next.

You have the basics down! :slight_smile:

Bubble is a visual programming language. This is the beauty of it. :wink:

Yes, … I am getting the hang of it. I am looking for someone to help me out for a few hours, to build an app for a project. I will pay for his/her time though.
Can you recommend me someone ?

Hello @michaelvrutaal

Below are two options:

Bubble (1 hour at a time)

Airdev (5+ hours monthly subscription)