# OH-repeater array item reference

**URL:** <https://community.openhab.org/t/oh-repeater-array-item-reference/157199>\
**Category:** Widgets\
**Tags:** widget, array, oh-repeater\
**Created:** [July 14, 2024, 8:15am UTC](https://community.openhab.org/t/oh-repeater-array-item-reference/157199 "2024-07-14T08:15:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zylle](https://community.openhab.org/letter_avatar_proxy/v4/letter/z/f475e1/32.png) [@Zylle](https://community.openhab.org/u/Zylle)\
**Post date:** [July 14, 2024, 8:15am UTC](https://community.openhab.org/t/oh-repeater-array-item-reference/157199/1 "2024-07-14T08:15:50Z")

</div>

I’m trying to reference an item in an oh-repeater array, and using the " [BoGoB: Big Ol’ Grid O’ Buttons](https://community.openhab.org/t/bogob-big-ol-grid-o-buttons/115343) widget as the foundation for my remote control widget.  
But rather than doing this, directly naming the actionItem in the array, which does work:

(shortened for brevity)

```yaml
- component: oh-repeater
                  config:
                    for: i
                    fragment: true
                    in:
                      - - 1
                        - 1
                        - 1
                        - 1
                        - Apple_TV_TvStue_Power_Status

                     - component: oh-button
                         config:
                           action: command
                           actionCommand: =loop.i[3]
                           actionItem: =loop.i[4]

```

I would rather have something like this, so I could have 1 widget and using that for several remotes:

```yaml
props:
  parameters:
    - context: item
      label: Apple TV Remote
      name: remote
      required: true
      type: TEXT
      ...
      - component: oh-repeater
                  config:
                    for: i
                    fragment: true
                    in:
                      - - 1
                        - 1
                        - 1
                        - 1
                        - =[props.remote]

                     - component: oh-button
                         config:
                           action: command
                           actionCommand: =loop.i[3]
                           actionItem: =loop.i[4]

```

I thought it was quite trivial to do (and it probably is! 😅), but I feel like i’ve tried all sorts of combinations with =items[props.remote], =items[props.remote].name, etc etc…its like I can’t see the forrest for the trees so someone please show me the forrest 😆

---

<div class="post-metadata">

**Author:** ![JustinG](https://community.openhab.org/user_avatar/community.openhab.org/justing/32/55948_2.png) [@JustinG](https://community.openhab.org/u/JustinG)\
**Post date:** [July 14, 2024, 3:34pm UTC](https://community.openhab.org/t/oh-repeater-array-item-reference/157199/2 "2024-07-14T15:34:24Z")

</div>

The yaml `-` character already defines the input that follows as an element of an array, so you don’t need to enclose the result of the expression in `[...]`. You just want `props.remote` not `[props.remote]`.

---

<div class="post-metadata">

**Author:** ![Zylle](https://community.openhab.org/letter_avatar_proxy/v4/letter/z/f475e1/32.png) [@Zylle](https://community.openhab.org/u/Zylle)\
**Post date:** [July 14, 2024, 3:56pm UTC](https://community.openhab.org/t/oh-repeater-array-item-reference/157199/3 "2024-07-14T15:56:54Z")

</div>

Thanks!!

```yaml
- =props.remote

```

The magic sentence.

🍻
