Anyway to create components dynamic?

I want everytime i hit add row button to create another container dynamic can anyone give me any solution thanks :slight_smile:

Hi @dinkok

Here's a basic example using a List View under the 'Repeatables' components:
image
Create a variable (arrListView in my example) with the initial value set to an empty array
image
Create a JS query that adds items containing a name and number element to the array based on the current length of the array.


Set the Data Source of the List View component to your array variable,
image
And then add your container with desired components to the List View and reference item.value for each (in my example, it's just a container with title and a text component displaying the length of the array).
List View:
image
Container Title:
image
Text:
image
Finally, create a button that calls your JS query, and the elements should begin populating.
retool_listview

1 Like

Thank you so much I need to do it I want to achieve to add rows for invoices so in those rows I'm going to add inputs where I put items and prices and total