Creating new groupings of data?

Hi, I want to have a way to create a new set of data fields. The user presses the “+” button and a new set of input cells pop up. I guess I use the Group to store the elements of the data fields.

In my example, I have a group containing 4 fields (all text type): carModel, carYear, carLicense, and carColor. The user will enter data into the fields, as in the illustration below. Then, the user will want to press the “+” button to create a new set of fields to enter data about another car. How do I enable this in the workflow for the “+” button?


You need to use Repeating group and create a new item when they press add +


1 Like

The repeating group element doesn’t seem to be the right thing. I created a 2x2 (2 rows, 2 column) repeating group element, but it seems to require that all 4 cells in this matrix are of the same data type. Also, it doesn’t appear that I can tap in any of the cells to add text. I can install an input element into the cell, but I can’t uniquely identify each element. When I drop an input element into the top left corner, and name it carModel, all other cells get the same name.

Right. You need to create a “thing” for that, that can be linked to other thing.
I don’t know what is the usecase, but according to your screenshot
Create a “thing” (I will call it “car_list”)
In this app, you will have a field that will be of Type thing that point to: Model DB, another field maybe of type “Year” that point this this DB if you have it, and maybe a final field that will point to Color DB if you have it. Same thing can be for the Plate.

Your RG will be set to car_list. And you will be able to use car list’s model field to complete your first cell.

I think that maybe you should explain how your current DB is set so we can help you. Where the model come from? Is this a DB that you have? A dropdown list will be used?..

The use case is the user is walking around and sees a car. He types “Camry” into the carModel field. Then types “2015” into the carYear field. And then types “7MHG433” into the carLicense field. And finally types “Metallic blue” into the carColor field.

He sees another car, hits the “+” button, types “Fiesta” in the carModel field. Types “2019” in the carYear field. Types “9LYM828” in the carLicense field. Types “Red” in the carColor field.

He then sees yet another car, hits the “+” button again, another new group of empty fields pop up and he types “Sentra” in the carModel field. Then types “2018” in the carYear field. Then types “8DHG845” in the carLicense field and finally types “white” in the carColor field. And so on.

There is no database to extract the car model names, years, license plate numbers, or colors from. All data are entered by hand by the user. That data will be stored in some database in the backend.

So in this case, All you need is
Car_list DB
With 4 text field: model, year, plate and color
When user click +, you create a new item
There’s different way where you can also use state and list of instead (like list of text). But it may be easier to create a DB. Also, if your user come back, you can search the last data from this user and show it again.

So I DON’T use the repeating group element, then, right?

Yes. You need to use a RG for this kind of stuff.
Or if you plan that user will not add more than 2, you can duplicate the first group and just hide the second one until user press +. But for “dynamic” number and unlimited number of item, you will need to use a RG.

1 Like

@edew you need to watch someone doing this. Here, I demonstrate exactly what you’re trying to do. This is core Bubble stuff that is easy to master once you see it explained:

I think I see how you’re envisioning how it’s used:

Create four input fields, the carModel field, the carYear field, the carLicense field and the carColor field. They’re the input fields. User types the input, and that gets sent to the carList database. That database’s data are then presented in the RG. So the four input fields are fixed (and doesn’t grow). The “+” button just takes what’s entered into those 4 fields and puts them into the database, and to present them in the RG.

Does that sound right?

What if the user wants to edit a field? Say, for the 2015 Camry, he mistakenly entered the license plate and wants to edit it. Does he tap in the RG for that section and get to edit it? Or, say he didn’t know the year make of the car, so he left it blank. Then, he gets back and enters it some time later.

This is one way.

But you can also create empty item in car_list before user start to fill information and user can populate it in RG. You can also use autobinding, so any change (or edit) are automatically saved

This topic was automatically closed after 70 days. New replies are no longer allowed.