Templates Plugins Courses

Comparisons between lists rg

Goodmorning everyone . I am trying to do something that is blowing my head. I am attaching some images to be clearer

I have these 2 rg nested. Now the numbers you see under each rg1 represent all the ids present within each rg2. Now every time the + key is pressed, I type in my order items table, entering it the id of that cell like this

Now what I need to be able to do is:
check if this order items contains a number equal to the max choice number of that specific group, then the button must be disabled. Example
image

Now I have already tried with a custom state, put inside rg2 which makes me +1 every time one adds an element of that list. The problem is that if it then goes to another product, the state does not reset and therefore inherits the values ​​it had during the first choice, plus playing with the state, I have no way of saying which elements are already present (in case of edit), while if you could compare lists then it would definitely be the best choice.

The condition should be something like this

"Do search for Order Items variants_list contains a number of items (which are within this group)> = of current cell choice_max then the button must be disabled

But I have not been able to impose this condition
Thanks in advance if anyone will be able to help me

Hi @edmondum, thanks for reaching out.

Checking the details you have provided, the first the most logical solution that comes to mind - is using custom states, as you did.
I’m sorry for not being able to help with more detailed suggestions, due to the fact the support team is not providing consulting/custom logic support services, but I’d like to suggest you study a bit more info about custom states use cases.

Perhaps, it won’t resolve your question completely, but I hope it will be useful for a bit:

Allow me also to recommend you to post your request to the Bubble forum - https://forum.bubble.io/ there are a lot more users, which can share their thoughts or suggestions on the question you have.

Hope it helps.

Regards,