Simple example oh-repeater rquiered

Hello dear community,
I am using openHAB 4.2.1 on my Raspberry Pi 5 and wanted to try out a widget in the widget designer with a repeater for the first time. Unfortunately, without success.

Grateful for any help.

freeET

your uid: GUI_TEST
tags: []
props:
  parameters:
    - context: item
      label: Item 1
      name: item1
      required: true
    - context: item
      label: Item 2
      name: item2
      required: true
timestamp: Dec 5, 2025, 3:03:22 PM
component: f7-card
config:
  title: Simple Repeater
slots:
  default:
    - component: oh-repeater
      config:
        sourceType: array
        in:
          - =props.item1
          - =props.item2
      slots:
        default:
          - component: f7-row
            slots:
              default:
                - component: Label
                  config:
                    text: =items[loop].label || loop
                - component: Label
                  config:
                    text: =items[loop].state
code goes here

You have three errors; two of them are related:

  1. loop is a general object that contains several different sub-objects so you cannot just use items[loop] you have to use items[loop.someLoopVariable]. But, how do you know what someLoopVariable actually is?
  2. Your repeater is missing a critical property which sets the name of the loop variable: for.

So the correct combination looks something like this:

- component: oh-repeater
  config:
    for: myVariable
    sourceType: array
...rest of config

and then

- component: Label
  config:
    text: =items[loop.myVariable].state

The third error is that items['Some Item Name'].label will not return anything. The items object is not a complete representation of an Item (that much data transfer for every use of items in the UI would cause a very slow and buggy interface). The items object only provides the State of the Item (as a string) and a few other often useful pieces of information such as the type of the Item and the State of the Item as a number (if it is a number type Item).