Increment value

Hi,
I want to create an incremental name for each text input created dinamically inside a Repeat Children.
For example, I need this format for each text input name, can be any name, var, home, asis, etc., the really important is the incremental number:
var_1
var_2
var_3
var_4


This is ok, but of course the last character should be incremental number, and this keeps in var_3 for each text input.

And this is what I really want, incremental number for each text input name generated with Repeat Children.

Sorry, I can’t figure out how to do that, I’m was checking this post: Increment Value with Button Click, but for me is the same, I can’t figure out how to do it.
Thanks in advance.

All element attributes can be made dynamic by prefixing dmx-bind: to the attribute.

For example for the id…

dmx-bind:id=“asis_{{ ($index + 1) }}”

$index gives you zero based counter of the repeat, and then you just add one if you prefer to start at one.

1 Like

Works perfect! Thanks, I’m was trying to figure out in UI, but appears to not be possible, I didn’t realize that dmx-bind can be customized in code. But in same way I don’t understand how works custom coding with dmx.
Thanks you so much.

That’s because in the UI it should look like:

dmx-bind:id=“'asis_' + ($index + 1)”

no {{ }} are used in the dynamic expressions in the data picker.

Works perfect! Thanks.

1 Like