Nested repeat index

Hello!

I have a nested repeat, that generates structured input fields as shown in a structure below. Every sub-repeat element generates index from 0, and I can’t figure out how to define “general” index for all repeat elements so I can use it as reference in multi-insert later.

The elements form structure like this (analogy for easier description would be Heading 1 and Heading 2 levels: H1.H2 )

1.1 $index=0 - but I need: 0 (= “general” index)
1.2 $index=1 - but I need: 1
1.3 $index=2 - but I need: 2
2.1 $index=0 - but I need: 3
2.2 $index=1 - but I need: 4
etc.

I have tried to determine max of $index of previous Heading 1 children elements to add it to the next Heading 2 children index, but so far unsuccessfully.

  1. I would highly appreciate any suggestions on how to achieve this.
  2. Is there a way in wappler to reference parent $index and $value?
1 Like