I have 10 dropdowns each with the same 20 names to choose from in each.
I can currently submit the choices to my data and store them.
But I don’t want to submit these selections if a duplicate selection has been made.
Create a workflow to ADD your dropdown’s value to this List everytime its value changes;
Bubble will not allow you to have duplicates in the List, so, in the end of the process, your List:Count must be equal to 10. If the amount of itens in the List is less then 10, then it means that the user selected duplicated options.
I have created a State at the page level.
I have selected my first dropdown in the workflow and set it to ‘Value is changed’.
Created an action - Set State. In the element list, I selected the page name. Custom state list I selected my State name. In the Value list, I selected ‘This dropdowns value name’.
I hope this is correct, as then I will repeat it for the other 9 dropdowns.
Im not sure where to go or how to do the List:Count part.
Hi there, @ianthistleton… I played around with this one yesterday after you posted it and before Rafeal replied, and for what it’s worth, I landed on the exact solution he described. That being said, it was a bit trickier than I thought it would be to get the custom state list to reflect the correct selections when dropdowns that already have selections in them are changed.
There could easily be a better way to do this, but all I could come up with was to rebuild the custom state list every time a dropdown’s value is changed. Here is an example where I am selecting letters from an option set in 5 dropdowns. In the first step of the workflow, I clear the custom state list by setting it’s value to empty, and the second step of the workflow looks like this.
The workflows are the same for the rest of the dropdowns, with the obvious exception of making sure the other four dropdowns are accounted for.
Finally, if you set your submit button to not be clickable by default (which you can do by checking the box on the button’s Appearance tab) and you add this condition to the button (in your case, the count would be 10, of course), you should get the desired result of the button not being clickable until the custom state list contains 10 items, and that will only be able to happen if there are no duplicates selected in the dropdowns.
Again, there is probably a better way to do this, and maybe someone will come along and educate both of us. Until then, I hope this helps.
Thank you for the help also.
I have also tried it your way, but for some reason, I keep getting an error when filling out the Value area. Not sure what I’m missing here.
I have created the State called SelectDrivers on my page called place_bets.
Does it matter what element i selected to create the State in… I have created it on the page level. My dropdowns are in a group inside another group on this page. Not sure if i was meant to create the State inside one of the groups.
The error message in the first screenshot is telling you what the issue is. Your custom state has the wrong state type… it’s a text, but it needs to be list of drivers.
But after completing all 10 dropdowns and the submit button, I tested it out by selecting the same name in dropdown 1 as well as in dropdown 2 and choosing all different names for the rest of the dropdowns. Unfortunately, as I hit the submit button it still submitted the duplicate entry.
And the first step in the workflow is clearing the custom state’s value? If so, it appears to be the same as the example I set up, and it should work. You shouldn’t even be able to click the submit button when you have duplicate values in the dropdowns.
That step should be on every dropdown, so again, it appears to be “correct,” meaning it is the same as my example, and it works for me.
To troubleshoot, throw a text element on the page and display the custom state’s value so you can see what’s going on in the custom state as you are selecting items from the dropdowns.
Ok so now when i make my ten selections and i make sure I selected a duplicate, the text box now shows up all names i selected except for one of the duplicates. So in the text box, it’s now showing 9 names.
But when i hit submit it still saves the data with the duplicate selection.
The button shouldn’t be clickable when there are only 9 names in the list. If you want to send me a link (via DM) to your editor, I can poke around under the hood.