Is it possible to nest form repeats I tried with both a converted row and the actual form repeat component and I got the same result twice:
As you can see formRepeat2 is inside of formRepeat1
But then when you import the fields into the workflow they appear as two separate arrays?
Marked as how to as I wasn’t sure if this is intended or a bug anyone know anyway I can make the second array be nested?
Bump…this would be nice to have
Just checking to see if there was any more traction on this @patrick - I want to access formRepeat1 index from every input within formRepeat2. Is this something possible?
Anyone find a work around to this? Trying to do the same thing. I tried putting a dynamic name tag usin g the outer repeat’s $index but no luck yet.
Can you give a real example where you need exactly this kind of nesting of forms? Have you tried using Repeat Children and inserting a form inside to send a request?
I’m creating a simple menu maker for a menu with two levels. The first repeat is for the top level and the second (nested repeat) is for any items that would be in the dropdown. Here’s a quick mock up.

I’ll try to clarify my proposal:
-
first you have an SC query in which you pass the first level data as ordinary fields, and the second level as a related table - in my case these are rental agreements and several offices in each of them
-
further on the front you create something like this nesting structure. It is important that inside each Repeat Children there is only one nested element - and already inside it you do any constructions
-
in the first Repeat Children, you directly specify the top-level data from the request to the server as the source
but in the second you take the second level not from the initial request, but from the first Repeat
Well, you can continue to do other behavior, for example, hiding nesting and beauty in forms as you want 
Thanks for the replies @vv-a2007, I have the front end working as expected using the same method, the problem I’m having is saving in the back end. Instead of the second repeat being a child of the first during $_POST, it is a separate array.
I may try manually binding each input name as an array name and see if that works. In theory it should.
I’ll let you know how it turns out.
Thanks,
Twitch
No go. I tried binding an array name with no luck.
dmx-bind:name="'menu['+varTopMenuItemIndex.value+'][submenus][$index][page_id]'"
It always just uses whatever the id=“IDName” is doesn’t seem to honor the binding. I also tried binding the id tag as an array for the hell of it, course that didn’t work haha.
I would just make two different SCs to handle POST requests from forms and not merge them into one
1 Like
I agree with @vv-a2007.
Can’t you just handle pages and sub pages Independently?
Update the pages with a form repeat.
Have the sub page of each page in a collapse just to wcand and view but in case of sub page updating click a button and open the specific sub page in a modal and handle them in a separate form repeat…
Just an idea…
Thank @famousmag, I may have to end up doing that. I have something close to working but not quite. I’m an old PHP hand coder and doing this sort of thing that way was a no brainer, but I’m working on my first NodeJS app so doing everything the “Wappler Way”.
When I first came across something like this, I also made separate modal windows for subordinate objects, and this makes sense especially when they have a lot of fields.
But now I think that in cases where there are few fields, a more user-friendly interface is when they are edited natively directly on the page.
Sometimes I use dynamic highlighting for unsaved entries and explicit save buttons, and sometimes I save everything automatically when data changes
2 Likes
I see what you say buddy…
But after a year using wappler, I believe that if something can be done through wappler UI (clicking buttons, binding values etc…) is waaay easier and of course easy on maintance than any language we could use…
I think this solution is a 1,2,3 setup solution, clean & clear in 15’ you’re done
1 Like