Simplify oh-repeater filter expression

Not really feasible, alas. The items object does not give you full access to an item, only the state and display state. The only way to get the information is from an api call such as the repeater makes. There are some workarounds if you nest a repeater inside another repeater. The most straightforward looks like this:

- component: oh-repeater
  config:
    for: array1
    ...whatever repeater options you need, including fitlers
    map: loop.array1_source <-- Put the whole repeater results array into each element of the loop
  slots:
    default:
      - component: f7-block
        config:
          visible: =loop.array1_idx == 0 <-- This block is now a block that will be rendered only once but has the full repeater result in loop.array1
        slots:
          default:
            - component: Label
              config:
                text: =loop.array1.length <-- Any component in the block can now access the array1 methods and properties
            - component: oh-repeater
              config:
                for: array2
                sourceType: array
                in: =loop.array1 <-- The repeater doesn't need to make another API call, it can just use the result array from the first repeater
              slots:
                defaults:
                  ...use loop.array2 to do whatever you want with your repeated elements
1 Like