Repeatable form component

Hi there,

I want to see if retool can meet the requirements for what this project needs as it hasn't been clear from playing around with retool or by looking at the docs.

The retool app would be for creating and editing these custom forms.

I have an API for creating custom forms with a general hierarchy as follows:

Form => Form field category => Form field (of which there are many different types which require different input)

My API has been built in such a way that it just saves full forms - so when you make a request you are passing all data in instead of the single form field you would like to add / update / delete.

So there are a few things I haven't been able to figure out:

  1. How to handle the repeatable nature of the categories and form fields?
  • Ideally there would be a button like "create new category" where you state the name and it gets added to the list of categories in the form
  • Then you would click add new form field -> click they type you would like to add and then show the relevant fields for that form field and then click save which would add the form field to the category

I cannot see how to create repeatable blocks within repeatable blocks though? i.e. how could I have a repeating list of categories each with a repeating list of form fields nested within its category

  1. How to manage everything via local state
  • On page load I need to run a request, transform the return into the data type I will store in "local state" and then store this value into local state and have the form read from this state and modify this state
  • The reason for this is that the API requires a full form to be saved, you cannot edit individual categories or form fields

Is this doable within retool? If so can anyone suggest how to do the above points or where to look if its documented?

I'd prefer to use retool as it seems for dev focused than something like bubble.io but not sure if it can handle these requirements or not

Hi @sturner!

Thank you for outlining your use case here.

Would something like a form inside of a list view work for you? If so, happy to explore more of that setup with you :blush:

Here are a couple examples of using a nested list view:

http://community.retool.com/t/creating-a-form-to-dynamically-add-data-from-selected-containers-using-for-loop/6268

http://community.retool.com/t/turning-query-table-into-nested-list-view-by-category/14274

https://docs.retool.com/docs/create-custom-list-views

I guess it would need to be something like this:

=> Form (nested list view for the categories)
==> Category (nested list view for the form fields)
===> Form field

I can't see how to add a new list element on the click of a button though? From the looks of it, there would have to be some kind of query to update the form which I don't want, I need the form to live somewhere local until "save" is clicked

Here is an image example of what I would like to build:

Hmm, would any of these posts be closer to what you're looking for? :sweat_smile:

http://community.retool.com/t/dynamic-listview-row-numbers/4922

http://community.retool.com/t/how-to-store-data-in-temp-state-using-listviews/6444/9

Sorry for throwing all these links at you, just want to understand your use case before launching into repro mode!