Updating a custom state list from text input upon button click

I have two custom state lists one is populated from a DB(thing) and is used as the items in a drop-down list. The user selects the item in the drop-down as the item to use, the user then enters a quantity to use and clicks a button.

The button action adds the fields from the drop-down list to the second state list and updates the RG.

My problem is how do I get the value of the input quantity to populate a list(QTY) in the second custom state list.

List 1:
Name = ‘test’
Ounces = ‘2’
QTY = 0 or blank

Input box value = 4

List 2:
Name = ‘test’
Ounces = ‘2’
QTY = 4 - this is the value I need to add to list 2.

My current workflow to update list 2 from list 1
image

If I understand right what you are trying to do, then the answer is that you can probably not achieve this in Bubble.

There are two constraints in Bubble:

  1. You cannot have duplicate items in a list. So you cannot add an existing item to a list yourself and hence replicate the shopping cart scenario
  2. You cannot have a local copy of “things” and hence create a list of those as custom state.

Solution is that you create a data type which holds the thing that you want to count and the associated count. Now whenever user selects some quantity, you update that entry in the DB.

My goal is to be able to add the value of an input box to a field in a list.
I relate a list to an array in other languages in other languages I am able to have statements such as
array(1) = ‘this’ - which would update the second item(count starting at 0) in the array
or a multidimensional array such as
array(1,1) = ‘that’ - which would update the second row, second column in the array.

list = item1, item2, item3, item4
RG text1 = list(item1), tesx2 = list(item2), text3 = list(item3), list(item4) = input(value)

I would like to the value of the input box to show in the repeating list item
image