To give you an overview of the model:
1/ Dropdown choices are “Items” (an object containing a value + a label)
2/ Questions (ie. each cell in the repeating group) is the question label + a list of Items
Display works fine.
But I’m stuck when trying to save the results of what the User selected.
In the workflow, I imagined that I would be able to save the data from “repeating group’s list - each cell’s - each dropdown value (and by value I mean the Item)”.
And save that as a list.
However, it does not seem possible to get all dropdown values…
(I managed to save all the items, but I just want the ones the user selected in the dropdowns, not all choices)
You would do “Make Changes to a Thing” in the workflow that is driven by the dropdown value being changed.
So set the field to the new one chosen. That is the “replace”.
Instead of waiting until right at the end of the process to save everything, you create a skeleton thing on the page load, then keep updating it as you go along. If you want a “Done” button then you can have this save some sort of status, updating it so that you know you have completed all the data entry,.
As mentioned before, I’m triggering events on Dropdown value change.
And to be able to remove the previous elements: I’m using a custom state for the Dropdown (I’m saving the current choice in the custom state). This way if the user changes his mind, I know which item to remove.
NB: 1 problem I have with this is that I haven’t found a way to re-establish the custom state at page load > this solution is not perfect yet as it does not allow me to edit an existing form.
Custom states can help here. You could also save these on the user, if you need to persist the data.
Are you having trouble setting up the custom state on page load ? Assuming you can’t get it from the saved data, then storing state on the user might help. I have persisted user choice through this route, although not as complex as yours.
Yeah, I don’t see how I can set a custom state for the Dropdowns in the repeating group.
(I have access to the correct data: I’m using it to set the initial value for the dropdowns)
For instance, I tried using the “When page is leaded”: I have access to the Repeating group, but not the Dropdowns.
I’m running into a similar challenge and was wondering if Bubble supports any simpler / more straightforward solutions to this type of challenge? I ask because this thread seems to be 235 days old.
I’m not sure I understand what you mean by “from the outside” – I’m still fairly new to Bubble. That said, I’m using a repeating group to collect an series of input fields and need to find a way to store these in our database and associate it with the other data I’m collecting in the same form. Just trying to understand how to best solve for this.
Some complicating facts:
The repeating group is triggered based on the user’s selected value to an earlier question.
I’m not using a list of things to store the answers because I’m going to need more than 1,000 rows.
I’m using this form to create new user accounts for other users.
The only way I know to save data from repeating groups is to save the data immediately when it’s changed because there’s no way to save it later. So, use a “when input field’s value changes” workflow and then save the data immediately.
We’ve ripped out all saving of data from a RG in our app where possible because it doesn’t work all of the time. Since it must save it right away and a user could say, change values twice sometimes the first value will hit the database after the second one and that’s what’ll save. Sometimes, it slows the page to a standstill. Sometimes, it creates other bugs that we could never figure out. So we try to always avoid this if at all possible, even if that means loading 10-20 of the exact same drop-down or input field.