Adding line to a repeating group trough my application

Hello :slight_smile:

You can see below something that I would like to do in my app :

So, I will try my best to make my goal clear, let me know if you don’t understand…

I would like to make a list of element with differents informations.
When you would first arrive on the page you would have something like follow :


Then when you click on Add, This would create a second line that you could also fill…and so on

I was thinking about using repeating group to create that but I don’t know how I can say “add a new line to the repeating group when the button add is clicked”

Does anyone understand my problem and how to do it ?

Thank you in advance for your help !
Best regards,

Your button click could just “create a new Thing” that is blank (no set values for fields) so that it could be in the database and the RG could display a new line.

Hi Roman, Thank you for your reply!
I am sorry but I am totally lost on how to do what I expect… if I create a repeating group I don’t know what to put in the “type of content field” as my contents are differents format.
And if I Create a Single Group I don’t know how to duplicate it Once I push my button add…

Could you please help through the forum app I tried some stuff but I don’t even know where to start…
Development tool : https://bubble.io/page?type=page&name=create_a_new_thing&id=forum_app&tab=tabs-1
view: https://forum_app.bubbleapps.io/version-test/create_a_new_thing?debug_mode=true

In fact I would like to avoid to create a new thing by pressing add, because I would like to add this field to my database only once the user we click an other “save” button.
These informations would be stored temporary because the user can, for exemple click on the cross to delete a thing…

I don’t know how to proceed, I am not sure if what I want to achieve is clear for you…
Please let me know your thoughts.
Thank you in advance for your help.
Best Regards,

Hi ! Does anyone haveon how I could do something like that ?

Hi @lise.nicolas, sorry i deleted my previous message because i realized my implementation was poorly done (it was very late and i didnt think about it well).
I’ve created a better one here which attaches the orders to users.
https://seanhootstest.bubbleapps.io/version-test/testorders
I want to share the editor with you but i’m still trying to figure out how to make it read-only so that no one can edit it (I may want to use it myself some other time)
Once i figure out a way to make the editor as read-only i will post it here but for the mean time let me explain how i did it.
Basically what you want is like a shopping cart functionality. The only difference is the way you add the items.
So in my database i have 3 things: Item, Order, User (the standard user table).
Orders has a field called Items which is a list of Items.
A User has a field called Current Order which is an Order.
A User has another field called Orders which is a list of Orders.

So whenever you click on Add, an Item is created, it is added the Current Order’s Items and the Current Order is attached to the user.
When the Save button is clicked, the Current Order is added to the User’s Orders and a new Current Order is created to receive the new set of items.
Hope this makes sense. Once i show you the editor it will make more sense.
But just think about how you will implement a shopping Cart because that is exactly what you’re doing.

Look at the following snapshots to see the workflows.
Add button workflows:

Save button workflow:

Also for the inputs for creating the Item, note that i made it a separate group from the repeating group for displaying the items. The nice thing about bubble repeating groups is that it will automatically shift the elements below it as it groups. So this implementation gives the illusion that you’re entering directly into the repeating group but it’s not. This is more of like a hack, a cleaner way will be what @romanmg suggested (i.e. creating blank item anytime you hit the Add button in addition to the actions above). See my design below

1 Like

Hi @seanhoots Thank you for your help ! I think that will be really helpfull, I will have a look on how you are doing it and will come back later to let you know ! In the mean time let me help you regarding your question about the App sharing, bubble created a “forum app” for this purpose:


You can create your own page( or work on mine) and copy paste with the workflow the example you already have done .

Hi @lise.nicolas, yes i’m aware of bubble’s forum app but not a big fun of it as its really bloated and takes too long to load sometimes. People accidentally break your demo code preventing other people from benefiting from it.
All the same i’ve just redone my implementation on the forum app and here are the links:
view https://forum_app.bubbleapps.io/version-test/createorders?debug_mode=true
editor https://bubble.io/page?type=page&name=createorders&id=forum_app&tab=tabs-1

Please not that to avoid name clashes with existing things i prefixed all my database things with sh_
So my things are sh_Item and sh_Order. Then i addeded the fields sh_Orders (list or sh_Order) and sh_Current Order (of type sh_Order) to the standard User table.
Hope this helps.

2 Likes

Thank you a lot for your help, I will play with it and try to understand what you have done, I might have some questions after ^^
Have a good day !

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