Saving multiple repeating group inputs

Alright, probably too tired to explain comprehensively, but I need to finish this. Been struggling with this for the past couple of hours and I cant get my head around it.

To keep things simple, I’ll use an example of the situation I have:

Clients (users)
Managers (user + manager’yes’)
Type: ‘Fruit’ (item name, weight)
Type: My Fruit List (item name, weight, quantity, total weight)

Page:
A manager logs in navigates to a page with a form that will create a fruit list for a client.
Input dropdown:
Client

Repeating group:
(input dropdown) Fruits: item name

Repeating group:
(input dropdown fruit’s value’s weight) Fruits: weight

Repeating group:
(input) quantity

(input) Repeating group
total (weight*quantity)

Save:
Create new thing > list of fruits > client=user > all fruits, weights, quantity and total

At one point I had this working but just for the first ‘row’ of items. I put all columns in separate repeating groups and also all in one repeating group (didnt know that was possible at first) but no success.

I tried to recreate the issue in the forum app but where in my own app I can select the fruits volume, in the forum app I cannot. So for what its worth: https://bubble.io/page?type=page&name=list_fruit&id=forum_app2&tab=tabs-1

I havent found any documentation on saving multiple repeating groups that displays data from one type, adds other data and create entries from another type.

I have also tried to just use input fields, but i have multiple entries for ‘item’ or ‘weight’ so i havent found a way to ‘save’ more than one of the same kind.

I think im just missing something so any help is more than appreciated!

1 Like

So I guess the issue is with the fact that you can’t save multiple things from the same type at the same time.
A solution would be to display the data in a group and have just one row of input fields. Each save would populate another row in the group that displays the data.

This is a nice solution but not vey user friendly. People would have to create quite large lists of items so it would be much better to edit the full table instead of each row separately.

Any thoughts?

Thought I’d just update this thread as it has had some views after all :slight_smile:

After more tinkering I created the following:

A user logs in (this is a ‘manager’).

The user selects a user (a client) from a dropdown.

The manager creates the following thing:

input 1 (a dropdown of item names from Object ‘ITEMS’)
input 2 (a number input that retrieves the ‘weight’ of input 1’s item)
input 3 (a number input that holds ‘Quantity’)
input 4 (a number input that is input2*input 4, which is Total weight)

On save it will create a new thing: 'selected user’s item list, resets the input to allow for another entry.

Below the input form there is a repeating group that returns:

Item list, search for Item lists with a constraint for the selected User. This returns all the items with their quantity and total weight. There is a delete button to remove errors.

This works, but it still doesnt solve my problem of creating more entries in one go. However, for the backend (which this is) it will work ok.

There is also a front end and there I want to present the User (client) with a prepopulated list of ITEMS which the user can add quantities of.

So my question now is:

can i present a user with a list of things from object ITEMS, have them add a quantity (the rest of the inputs as in the backend are hidden) and save a batch in one go?

With regular input fields this would be impossible i guess because you are saving the same thing multiple times so I guess it would just overwrite each entry with the latest?

A repeating group? I get stuck at trying to retrieve an item’s weight as the second ‘column’ in the RG. The RG doesnt let me search Input.Item.Name’s value’s weight.

working on some solutions as I submit this. will keep myself posted through the forum :stuck_out_tongue:

1 Like

Ok, well I think I found the answer elsewhere in the forum. It doesnt seem possible to save multiple items from a RG in one go. I changed the experience to just save an item at a time, which would work fine.

What you can do is create a repeating group that creates a new thing when you select an input.

And on Save you can update the list.

1 Like

wouldnt that ‘creating a new thing’ be the equivalent of saving?

Hi there, had anyone been able to find a work around for this? I have products which is displayed in a receiving group and i have a checkbox which indicates availability. i have a button add. I want to save all available items in a a table called available products but i cant seems to find a workaround for it.

I noticed that when the checkbox is checked, it adds a record yes in the available product table but no product name and it only add one line

Any Help is really appreciated as im a total newbie at this.

1 Like

Curious if you were able to get auto-save to work. I haven’t been able to figure out how to do that.

I am also very interested in an auto save option for inputs within a repeating group. Currently the only option I have found is to have save per each row, but that is not a great user experience.

1 Like

Hi
Not sure if this is what you are looking for but I posted a similar question and got a solution.

Save each row in a repeating group

1 Like

Thanks! I did see that solution and that was my backup, until I found the calculator/element changed option.

1 Like

What is the calculator/element changed option?

1 Like

That did not work for calculated values. I have a RG with an input that will change when Quantity changes outside the RG.

I’ve been looking for this solution past 2 manths …

Can’t figure this out…

I have a dynamic number of dates, but not sure how to save inputs altogether without saving them individually and without using autobinding. Need them as custom states and all saved together in one press of a button

Screenshot_504

Hi Carlos, I’m looking for a solution to this as well - did you find out how to save calculated values from an input in a RG?

Hi Giblin . .
No I have not found a solution. In fact I believe there isn’t any and that’s on purpose.
What I do is to input values by clicking individually each line an I set the save/ close button to be disabled until all lines are sent.

1 Like

You can use the free plugin called Orchestra. It allows for communication between repeating group cells and outside of the cell. I just used it to setup a feature for a user to input a number of adults, and then show a repeating group where the user will have a date picker to select the birthdate of each adult.

Then on save, I use the features of the free plugin to set a custom state, which is a list of dates, and after it has completed, I save to the database the custom state value.

1 Like