How to change values in a list of numbers?

Probably an obvious question, but does anyone know how I might change a specific value in a list? This is my database called ‘Email Infos’ (values underlined in yellow):

And here is my workflow, which is supposed to change one of the values:
database_numbers_3
For example, I’m looking to do something like:

line_item_price [set value:first item's] Input Quantity's value ...

… which would replace the first item (111) with the Input Quantity’s value.

But there’s only the [set list] option, which overwrites the entire list. What’s the best way to do this?

Need another datatype so you can have a row in your database per line item. So each Item has one price and one image. Then you can easily modify a single item’s price in your database.

This also will help because you’re gonna run into issues if the same number needs to be in that list twice, Bubble no likey when that happens

Interesting, so if I’m understanding this correctly, instead of having one database entry per order (with a list of texts/numbers for each line item) I’d have one database entry per line item? Like this?

Order would stay as a datatype, containing all order-related info. But you need a new datatype Order Item, that would have a field Order (type Order) so it has a reference back to the Order, then the price, quantity, etc. for that specific line item of the order :+1:

Optional is on your Order you have a list field containing all the Order Items

I think I understand, so I’d have one datatype Order Info, and another datatype Line Items that contains each line item from the order and an Order Info field:

Only problem now is the backend API workflow I’m using to populate the DB was pretty straightforward, and now I have to figure out how to create multiple Line Item entries for orders with multiple products:

Would this be a use case for recursion? Something like this?

Bulk create API (schedule API workflow on list or recursive might be appropriate too and possibly easier to set up)

Miracle that Bubble hasn’t added create a list of things given that make changes to a list of things exist and it’s not like we’re not paying for the privilege…

Yea Bulk Create is best for this, you can take the list from your API response and send to your own app via API connector and it will make all the things. Really annoying to setup cause like my boy said no “Create a list of things” action made yet :sob:

1 Like