I have a LIST which is a STATE of a element. I am adding the value of a input field to that List every time a button is pressed. I have a Icon which I need to setup a Conditional Rule which would change the icon depending on if the value is the list 1 time or 2 or more times. I cant figure out how take a value and check it against the LIST in the STATE and see if the count is equal or larger then 2.
If the value is in the list 1 time then the conditional rule should be X
If the value is in the list 2 times or more then the conditional rule should be Y
Hi @shawn.chaudhery, sorry, my previous reply I missed reading where you say you have the value of an input field. That workaround for duplicate counting won’t work.
Bubble’s list functions which create a new list, including :plus item, :filtered, etc always remove duplicate items. It is a nuisance when you do want duplicates.
One workaround is to use Javascript expressions to build the new list or check for duplicates.
Another workaround is to have a list of unique database rows, the field values can be identical without the list having duplicates.