# Repeater problem

**URL:** <https://forum.wixstudio.com/t/repeater-problem/73397>\
**Category:** Ask the community\
**Tags:** cms, wix-studio, wix, code\
**Created:** [September 7, 2025, 12:36am UTC](https://forum.wixstudio.com/t/repeater-problem/73397 "2025-09-07T00:36:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ron\_Carran](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ron_carran/32/81993_2.png) [@Ron\_Carran](https://forum.wixstudio.com/u/Ron_Carran)\
**Post date:** [September 7, 2025, 12:36am UTC](https://forum.wixstudio.com/t/repeater-problem/73397/1 "2025-09-07T00:36:18Z")

</div>

**I’m having trouble with an image in a repeater.**

**I have a repeater with 3 text items and one image item (image18). I want to collapse the image item if the value of the data for that image is undefined. My code seems to get to the correct place, but the image doesn’y collapse. Here’s the code.**

**if** (wixWindowFrontend.formFactor === “Mobile”) {

```
$w("#repeater1").onItemReady(($item, itemData, index) => {

```

**if** (itemData.image === **undefined** ) {

console.log(“COLLAPSE”);

$w(“#image18”).collapse();

} **else** {

console.log(“EXPAND”);

$w(“#image18”).expand();

}

});

}

**Working in**  
e.g. Wix Studio Editor, Wix Editor, Dev Mode, CMS, etc.

**Site link**  
If this is happening on a site, include a live or test site link

**What I’m trying to do**  
Describe the goal or outcome you’re hoping for

**What I’ve tried so far**  
Let us know what you’ve already tested, changed, or searched

**Extra context**  
Anything else that might help - edge cases, screenshots, etc.

---

<div class="post-metadata">

**Author:** ![onemoretime](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/onemoretime/32/104023_2.png) [@onemoretime](https://forum.wixstudio.com/u/onemoretime)\
**Post date:** [September 7, 2025, 12:54am UTC](https://forum.wixstudio.com/t/repeater-problem/73397/2 "2025-09-07T00:54:27Z")

</div>

Hi, @Ron_Carran !!

For now, please try it this way. 😇

```javascript
    if (!itemData.image) {
      console.log("COLLAPSE");
      $item("#image18").collapse();
    } else {
      console.log("EXPAND");
      $item("#image18").expand();
    }

```

---

<div class="post-metadata">

**Author:** ![Ron\_Carran](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/ron_carran/32/81993_2.png) [@Ron\_Carran](https://forum.wixstudio.com/u/Ron_Carran)\
**Post date:** [September 7, 2025, 3:53pm UTC](https://forum.wixstudio.com/t/repeater-problem/73397/3 "2025-09-07T15:53:06Z")

</div>

Thanks so much, onemoretime! It worked perfectly.
