[Solved] How to downvote / remove an item from a list of items in the database

Hi, I am trying to create a voting funtion, where the user can click an icon to upvote, and then click the icon again to downvote.

I have a Votes field, type User

I can add the user to the list, but I can’t work out how to remove the user from the list…

Hi there, @StandUp… the short answer for one way you can go here (assuming you are set on going with a list of users) is to put conditions at the workflow event level to determine which event to run when the user is already in the list and when they aren’t. So, something like this.

Hope this helps.

Best…
Mike

1 Like

Just do the opposite of wherever you did to add them to the list…

(although adding and removing Users to lists is probably not the right approach here…)

1 Like

Hi Mike, I have put the condition of which event to run, but the problem I am encountering is that there is no remove option, only an = option

image

Then your Votes field isn’t a list. Also, your condition at the event level isn’t right for that same reason.

1 Like

Aha! Blast, so easy to make a simple mistake!! Thanks so much

1 Like

What’s the right approach - separate upvote datatype with page and user fields?

Yeah that would make more sense.

2 Likes

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