List View resetting data when number of items change

Hi there,

I'm building out a form within List view that has a dropdown selection and a textInput component.
The number of items is based off a temporary state variable I've set up based off this post: How can i duplicate the component using button click in same app which essentially allows users to add rows to the listView by incrementing/decrementing the value being used to define the number of items.

I'm allowing users to add as much fields as they need and select from the drop down for every row and input values into the text field, however, when selecting the "Add" or "Remove" button to modify the number of items, any filled textInput or dropdown selections will be reset to the default values.

Is there a way for listview to persist the property when the number of items have been changed?

1 Like

I think by making a script where you store the listView data in a temp state variable, add the row and then set the listView data to the prev saved data

1 Like

You need to write script to refill the input fields.
Screenshot 2023-11-21 080115
Screenshot 2023-11-21 080137
Screenshot 2023-11-21 080213
Screenshot 2023-11-21 080249