How to create var for input field in array (not using data grid)?

I display a shopping cart array with object for each product added to shopping cart

I want user to update amount of products in shopping cart

Ive added input field to my list of products and I bind initial value of input to existing amount of items for specific product

when user change number in that input I want to change object.amount

When input is in the array it has no variables that I can bind to my formula

Is there any way to create vars or should I only use DataGrid feature for that?
It looks like easier to update only 1 field with just generating a vars for each input in array like my example then customise DataGrid…

Use an onChange workflow. When the user changes the quantity, update the array variable.

Again. You’ll need a tiny bit of JavaScript:

  1. For that quantity input, add an onChange workflow
  2. add a custom JavaScript action

The custom code should be something like this for your variable names:

variables.ShoppingCart[context.item.index].quantity = event.value;

1 Like