Dynamically appending form Fields

I will like to append the following form fields when the button Add next exercise or add next group is clicked

Hey, so I had the same problem. I solved it by:

  1. Using a listview component and putting my form fields in there.
  2. Creating a “number of rows” state variable (initialized from the db)
  3. creating 2 javascript queries, one: “increase rows” and, “decrease rows” all they do is, they get the state and increase or decrease it
  4. finally i reference that state in the listview component as number of rows.
    Works like a charm:)
    as a neat additional thing you can put this into the “show when true” part of your button component:
    {{listview1.data.length !==i+1}}
    then it only shows the last button.
4 Likes

Thanks for your response. I was able to solve it by using react json schema form![json schema|690x272] . this allow you to build your forms from a json schema. (upload://s7VJC6bU6eA2i3dps22ijV06PUp.jpeg)

1 Like