Repeatable : add remove instance by button click

Hi,

This is a common functionality that comes up time to time. We need some kind of dynamic repeatable. There will be two button one for adding an element another to remove.

Previously did something with list , is there any ready to use component for this.

Maybe there can be a small marketplace for retool components ? where user can build / share some component that can be plugged to create new apps.

my use case: user will add a component in repeatable list , it will have some components like check box , text input -> on saving these values should be saved in db

thanks

Hey @mpmohi,

I provided a potential way of doing this with listviews on this post where you can download also a sample app with the functionality.

Let me known if you need further direction on this.

hey @MiguelOrtiz ,

Thanks for you reply, yes this is a very good example and sample app.

However when I am removing some item it will reset all other fields. Now if I have a complex group like multiple select and text box etc , it will be inconvenient for user to fill same information many time.

this will remove selected index But I can't keep the actual values of elements.

let removed = _.pullAt(testerState.value, [i]); 
console.log(removed, i+1 )
testerState.setValue(testerState.value)

something to do with "listView1.instanceValues" I guess but not sure how.

thanks