Create multiple entries within an entry

Hi!

I’m new to Bubble and only starting. I’m trying to create a simple tool, which would allow me to create an order book.

I have two data types - Order and Product List.

I have created a form where the user can input Order parameters: Date, Client Name, Order Number and Status. This part works just fine. However, within the same form order I have added a repeating group, which allows to assign a list of products to this order. The input fields for each line are parameters of Product List: Order Number (non-editable, assigned from above), Product Type, Unique Product ID and Quantity. The user should be able to add as many lines (entries) within the RG as they wish for a single Order.

This is where I’m a bit lost - setting the source of RG to search for Product List, the form allows me to create, edit and database entries, but always displays all already existing items in the Product List database. I would like it to start from blank for each form and add the input values to the data.

Can you please suggest a solution?

Okay! can you provide a screenshot to help us better understand.
Or if you don’t mind we can solve the issue together on a free 15min call

Hi,

Thanks for a quick reply. Attached is a screenshot of what I want the popup to look like.

The row below “Order contents” is an RG, for each form I would like it to start empty, and once the data is filled in by the user to be added to the database.

Create a Custom State:

Select the page (or a reusable element) where your form resides.
Add a custom state (e.g., tempProductList).
Set its type to Product List (if you created a separate data type) or list of texts/objects based on how you’re structuring the products.
Set it as a list (check the “This is a list” option).
Set the Repeating Group Source:

Change the data source of your RG to the custom state tempProductList.
Add Items Dynamically:

When the user fills out the fields for a product and clicks an “Add” button:
Use a workflow to:
Add the new product details to the tempProductList state.
This would look something like:
Set State → tempProductList →
tempProductList :plus item →
[Create a temporary product object].
Save the Order and Associated Products:

When the user submits the form:
Save the Order entry first.
Loop through the items in the tempProductList and save them to the Product List data type, linking them to the created Order.
Reset the Form:

After saving the order and product list, clear the tempProductList state and reset the input fields to prepare for a new order.

Hi!

Thanks a lot for the answer. I have not used custom states before and this is a bit confusing. How do i set the data source of RG to custom state? The data source field when input Do a search for only lets me select a data type from the exisiting databases.

With some trial and error I managed to resolve this, but with everything set up, when the page is loaded the RG now does not show any of the input fields, instead is empty.

The source is set to the custom state list, which is empty - perhaps it should also somehow add a blank record upon loading?

did you manage to find a fix to this?