-
Goal: As an user I want to have one input text and if I need to add more items I could click and one more input text is displayed
-
Steps: none.
-
Details: I don't want to use multi select because for those the options are fixed. I need the posibility to display as many input text as the user wants while using the app and all of those values I will save them as a list.
-
Screenshots: -
Hi @Aida_Perez, first of all welcome to retool community!
I think to achieve what you need the best way is by using the table component in editable mode and add the button "Add Row" under toolbar buttons. This way every time you want to add a new value you just need to click on add new row.
Hi @Aida_Perez,
welcome to the forum!
Another solution to what @Almopt suggested is using a listView. The steps are a little bit more complex, especially if you're not familiar with them. Let me try and break it down for you. I have attached also a json app which you can import so you can use as reference and see how does it work.
List view example for dynamic text inputs.json (10.5 KB)
- Create a variable, let's say it is called options. In the default value you can add [{"option":null}]
- Use that variable as data source for your list view
- Add + and - icons that will update your variable adding/removing arrays so you can have an additional text input.
You can then refer to your listView insanceValues properties to pass it to your queries and update databases:
Hope this helps!
Hey Miguel thanks a lot for your suggestion. I've never used the ListView component.
These icons you mean I should add them as buttons? Or what?
Hi @Aida_Perez,
I've just buttons indeed, but you can use icon components if you prefer.
Both are great options - @Aida_Perez, let us know what you end up going with.
For folks following along, another option could be a JSON Schema form, but I'd recommend the table/list view options first since they are more updated & integrated with Retool