Let your users dynamically add or decrease the number of elements

Hi Bubblers,

Pretty sure most of you already know this but I hope those who are still starting out will learn from this (I’m one of them)

You can let your users dynamically add or decrease the number of elements

To do this you would need to make use of:

  • Repeating groups
  • Custom states
  • Toolbox’s list of numbers

Steps:

  1. Create a custom state for either the page or the element
    image

  2. Add Toolbox’s list of numbers and use number 1’s custom state as the length of the list
    image

  3. Add a repeating group and use number 2 as the data source
    image

  4. In the repeating group, add your element (groups, inputs, RGs, anything)

  5. To let the users dynamically add or decrease the number of elements, you could add a button or an action that would add/decrease number 1’s custom state value

There you have it, you can now let users dynamically add or decrease the number of elements :grinning_face_with_smiling_eyes:

This is by the way a solution for my problem that I encountered a few days ago

Dynamically creating elements with inputs

If you have any other workarounds or solutions for this, please do comment below

Ok but how do you store in db the data from dynamic inputs ?

I mean, on my side, I have almost the same behavior.

A form contains one block of input elements. The set of inputs (the block) will be a data type in db.
And I can dynamically add new blocks.
What I would like now is : by clicking on the save button, it should create each data type in the db. But I cant see how to retrieve those dynamic inputs/block to create a dynamic number of data type

1 Like

Hello,

For you to get the values in each input, I suggest you check out the Orchestra plugin, it’s a really powerful tool to use for your repeating groups.

Hope this helps!

Best,
Nino