Proper management of instance values within a listView component

  • Goal:

My goal is to get visibility into every instance value of my listView component ("createInvoice_ListView"), which has a data source set to a javascript variable (initial value of [1]) and consists of one or more containers... each container with 7 input components, therefore, I should be able to see all of them when looking at "createInvoice_ListView.instanceValues". The amount of containers in this list view starts as only 1 (denoted by the data source mentioned above), though this increases when the user clicks a button to add more if necessary. My issue is, when there are 2 containers in there for example and I look at "createInvoice_ListView.instanceValues" in the console, all I see is this:

  1. (2) [Object, Object]

  2. :arrow_forward:0: Object

1. primaryKey: "1"
  1. :arrow_forward:1: Object
1. primaryKey: "2"

Instead of just seeing the primary key, I should be seeing keys and values for each input field per container.

  • Steps:

  • Details:

The javascript variable that I mentioned above that is the data source for the list view starts as just an array equal to [1]... this variable is named "createInvoice_Containers". When the user clicks the "+" button to add a container within the listView, the following code executes:

createInvoice_Containers.setValue([...createInvoice_Containers.value, createInvoice_Containers.value.length + 1]);

Taking the array to [1, 2]... [1, 2, 3] and so forth. This correctly populates an additional container each time it is clicked, but the values of the inputs within each container appear to be inaccessible via instanceValues of the listView.

  • Screenshots:

Initial view of the page containing the listView:

After clicking the "+" button (you can see another one appears for the user to scroll through to fill out):

Have you tried refreshing your page? Sometimes this is necessary after you've enabled instance values in your list view

I hadn't tried it as I thought it was already enabled since the last time I worked on it but that seemed to have worked. Thank you.

1 Like