Sorting dropdown not counting 0 as the lowest value

I have a dropdown sort filter where the user can sort from lowest votes to hightest votes and from highest votes to lowest votes.
However the filter only counts 1 as the lowest vote. so items with 0 votes are always at the bottom of the list.

Any ideas as to how to include 0 in the vote count?

Does anyone have any ideas what could be the solution here?

If you sort it in ascending order, 0 becomes first on the list. Does the 0 votes are just empty votes?

I have been trying to upload a video showing the issue but its not accepted.

So ill try to explain,:

  • A user makes a new entry for a toy. and this toy had the option to be upvoted once by any user and that vote can also be removed by that user (but the voted cant go into negative).

  • The search function can be by text input whare the user searches the title or by a Dropdown (DD) menu. with options:
    Newest to oldest
    Oldest to newest
    A-Z
    Z-A
    Votes lowest to highest
    Votes highest to lowest

  • Everything works as it should except for the votes search

  • If there is a new entry the votes are at 0, if a search Votes lowest to highest is used then the new entry is at the very bottom under the highest voted toy.
    If one voted is added to the new toy and then removed again so that the votes are still at 0 and the same Votes lowest to highest is applied then that toy is displayed correctly and will be at the top of the list with the other toys that have 0 voted but have had the same +1 then -1 vote action applied.

  • Any toy that has not this “+1 then -1 vote action applied” will not regeistered in the search and will appear at the bottom of the list bellow the highest voted toy.

  • Obviously a new toys votes is not counted from Zero. the issue I’m having is that I can tfind where to enter an expression to make the count start at zero. (the other strange things is that I dont understand why it works once a +1 then -1 vote action has been applied manually.)

Doest this description make sense to anyone? and what are your thoughts on it?

It’s hard for me to visualize what is your problem but what you should do is in your table create a vote with number as a datatype and 0 as a default value. When user create a toy then the vote is automatically 0, when the user click on +1 vote use make changes action to add 1 to the vote same with -1 vote subtract the vote. Then you should add a condition in the -1 button that if the vote equals 0 then disable the button.

After you done that, sorting will be very easy.

If you already made this workflow, provide a screenshot so that we can check it.

1 Like

Dude! thanks so much and what an easy fix… I just had to set the default value to 0 in the database as you said. @yamada.shoji99 thank you mate!

I was searching for all kinds of complicated expressions and workflows and it was a 10 second fix.

1 down!.. Now I can move onto my other issues that I havent been able to solve yet.

I really appreciate your assitance
Regards
Simon

1 Like

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