Read dynamic variable from oh-input in oh-repeater

How can I read the variable of oh-input located in oh-repeater?


  - component: oh-repeater
    config:
      for: repVar
      sourceType: itemsInGroup
      groupItem: =[props.grpItem]
      fragment: true
    slots:
      default:
        - component: f7-row
          config:
            style:
              order: =loop.repVar_idx
          slots:
            default:
              - component: oh-input
                config:
                  type: text
                  variable: ='myInputVariable' + loop.repVar_idx.toString()
                  
                  
              - component: Label
                config:
                  text: =['vars.myInputVariable' + loop.repVar_idx.toString()]
                  #returns [ "vars.myInputVariable0" ]
              - component: Label
                config:
                  text: = 'vars.myInputVariable' + [loop.repVar_idx]
                  #returns vars.myInputVariable0
              - component: Label
                config:
                  text: = vars.myInputVariable0
                  #returns the entered value (input)
              - component: oh-button
                config:
                  text: save
                  action: command
                  actionItem: =loop.repVar.name
                  actionCommand: =vars.myInputVariable0

vars is not part of a strong when referencing the input variable, it is the variable object. So, that portion of the expression must not be inside quotes. You want to access to the key in the vars object that you build from the string literal and the loop index. When you access a dynamic key name like that you put that inside [ ]. So, in this case you want:

text: =vars['myInputVariable' + loop.repVar_idx]

Short and with additional background information…
Thanks a million.

- component: f7-block
  config:
    style:
      display: flex
      flex-direction: column
  slots:
    default:
      - component: oh-repeater
        config:
          for: rPreset
          sourceType: itemsInGroup
          groupItem: =[props.grpPresets]
          fragment: true
        slots:
          default:
            - component: oh-input
              config:
                style:
                  display: "=(vars.modeTYPE == true) ? 'flex' : 'none'"
                placeholder: =loop.rPreset.state
                outline: true
                type: text
                variable: ='varInput' + loop.rPreset_idx
            - component: oh-button
              config:
                text: ="P" + (loop.rPreset_idx + 1) + "= " + loop.rPreset.state
                style:
                  display: "=(vars.modeTYPE == NULL || vars.modeTYPE == false) ? 'flex' : 'none'"
                  order: =loop.rPreset_idx
- component: oh-button
  config:
    text: save all
    action: command
    actionItem: =loop.rPreset.name
    actionCommand: =vars['varInput' + loop.rPreset_idx]
    #how can I get access to varInput0(...to 4) from this level?

If I configurate the save-button as part of the oh-repeater, I can write each input to each preset-item.
But if I drop this button outside the oh-repeater, it’s not able to read the value.
I know, why it has no access to the value, but how can I get all (5) oh-inputs written into my 5 preset-items?

The best way to do this is to this is to run a rule from the widget and pass the input variables to the rule using the rule context property of the rule action. The rule can then process the values however you wish and send the results to any items.

It is possible to do this all within the widget system however, so the fully widget way of doing this would follow

But will be kind of ridiculous for five separate items.