Modifiable ListView

I'm trying to modify data that is presented in form of an array. While listview serves well for display purposes, I haven't found an easy native way to modify such lists. For example, I might want to delete an item from the list or add a new one. Do I need to write a custom component for this, or am I missing out something?

1 Like

Hi @fres_af!

You should be able to accomplish this with JS in many different places inside of Retool! One such place would be a JS Code query:

Or pretty much where ever you can use {{ }} !

1 Like

It can be good to store your original data in a temp state variable. Then have everything in the listView reference that temp state variable. Whatever updates or changes you make, make to the temp state variable, and the listview will automatically update. Turns out managing the state and original source of data in your apps is a really difficult process and there's no one right answer, but I've found that having the data stored in a variable that's separate from the component is really helpful! Make sense?

Justin's answer to a similar question in this thread is pretty applicable here.