# Filtering visibility group / other components on 0 iterations in repeating container

**URL:** <https://community.appfarm.io/t/filtering-visibility-group-other-components-on-0-iterations-in-repeating-container/1252>\
**Category:** Ask the community\
**Tags:** ui\
**Created:** [May 24, 2024, 12:30pm UTC](https://community.appfarm.io/t/filtering-visibility-group-other-components-on-0-iterations-in-repeating-container/1252 "2024-05-24T12:30:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Preben](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/preben/32/545_2.png) [@Preben](https://community.appfarm.io/u/Preben)\
**Post date:** [May 24, 2024, 12:30pm UTC](https://community.appfarm.io/t/filtering-visibility-group-other-components-on-0-iterations-in-repeating-container/1252/1 "2024-05-24T12:30:45Z")

</div>

Hi,  
Is there by any chance a smart way to identify if a repeating container has any iterations for components outside the iterator?

I often have the need to hide a container/use visibility group if there is no items to show, but I would like to avoid trying to replicate the filter for the repeating container as this require more maintance later if filters needs to be updated

Typically I have a header before a repeating container that can not use the iterator count context variable that the repeating container itself can use.

![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/a/a82ba98f1a3ff444b90cf68f5d78ebcdd0bc71b8.png)

---

<div class="post-metadata">

**Author:** ![oyvind.byhring](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/oyvind.byhring/32/1060_2.png) [@oyvind.byhring](https://community.appfarm.io/u/oyvind.byhring)\
**Post date:** [May 27, 2024, 8:37am UTC](https://community.appfarm.io/t/filtering-visibility-group-other-components-on-0-iterations-in-repeating-container/1252/2 "2024-05-27T08:37:18Z")

</div>

You can’t access info about another UI element directly, but maybe a setup like this could work, depending on your use case?

![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/2/22036b11fdc24239258535a05ca027d774d4950f.png)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/c/c72364b4ed0deef05a00f90d0b65207bb0dbdd05.png)

The iterating container has 2 containers - one that is always visible for the content, and one that is only visible on the first iteration for the header.

Edit: I see now that you specifically need the header outside. What about making an app variable with a function that calculates the visibility as a boolean value?

---

<div class="post-metadata">

**Author:** ![Preben](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/preben/32/545_2.png) [@Preben](https://community.appfarm.io/u/Preben)\
**Post date:** [May 27, 2024, 8:57am UTC](https://community.appfarm.io/t/filtering-visibility-group-other-components-on-0-iterations-in-repeating-container/1252/3 "2024-05-27T08:57:20Z")

</div>

Thanks for the tip. This is the only way as I can see it to have headers etc inside the repeating container and use the first iteration.

But it would be great to be able to set a variable to be updated e.g. with the number of repeating elements in a container - so that the visibility also could be used other places without repeating the filter

---

<div class="post-metadata">

**Author:** ![ErikAKSkallevold](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/erikakskallevold/32/1378_2.png) [@ErikAKSkallevold](https://community.appfarm.io/u/ErikAKSkallevold)\
**Post date:** [May 27, 2024, 5:55pm UTC](https://community.appfarm.io/t/filtering-visibility-group-other-components-on-0-iterations-in-repeating-container/1252/4 "2024-05-27T17:55:41Z")

</div>

> [@Preben](#):
>
> But it would be great to be able to set a variable to be updated e.g. with the number of repeating elements in a container - so that the visibility also could be used other places without repeating the filter

Sounds like a cool idea. I’ve created a feature request for this functionality 🙂

// Erik
