# How to hide repeating group if empty

**URL:** <https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520>\
**Category:** Database\
**Created:** [July 12, 2019, 12:04pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520 "2019-07-12T12:04:25Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulogustavopeixoto](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/paulogustavopeixoto/32/253627_2.png) [@paulogustavopeixoto](https://forum.bubble.io/u/paulogustavopeixoto)\
**Post date:** [July 12, 2019, 12:04pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/1 "2019-07-12T12:04:25Z")

</div>

Hello guys, I have a repeating group in my app which I want to hide or collapse height if it doesnt return any results. How can I achieve this?

---

<div class="post-metadata">

**Author:** ![andrewgassen](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/andrewgassen/32/44248_2.png) [@andrewgassen](https://forum.bubble.io/u/andrewgassen)\
**Post date:** [July 12, 2019, 12:44pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/2 "2019-07-12T12:44:44Z")

</div>

You can use a conditional statement that if the count of items returned by the repeating group search is zero, hide the repeating group.

---

<div class="post-metadata">

**Author:** ![paulogustavopeixoto](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/paulogustavopeixoto/32/253627_2.png) [@paulogustavopeixoto](https://forum.bubble.io/u/paulogustavopeixoto)\
**Post date:** [July 12, 2019, 12:48pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/3 "2019-07-12T12:48:05Z")

</div>

that would work yes, but I found a problem which is the fact That I end up with an empty spot. Any way to collapse height?

---

<div class="post-metadata">

**Author:** ![paulogustavopeixoto](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/paulogustavopeixoto/32/253627_2.png) [@paulogustavopeixoto](https://forum.bubble.io/u/paulogustavopeixoto)\
**Post date:** [July 12, 2019, 12:50pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/4 "2019-07-12T12:50:02Z")

</div>

I may have found out how, I would have to put it inside a group and collapse the group when empty.

---

<div class="post-metadata">

**Author:** ![paulogustavopeixoto](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/paulogustavopeixoto/32/253627_2.png) [@paulogustavopeixoto](https://forum.bubble.io/u/paulogustavopeixoto)\
**Post date:** [July 12, 2019, 1:42pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/5 "2019-07-12T13:42:57Z")

</div>

does not collapse unfortunatly

---

<div class="post-metadata">

**Author:** ![robert](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/robert/32/149181_2.png) [@robert](https://forum.bubble.io/u/robert)\
**Post date:** [July 12, 2019, 2:44pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/6 "2019-07-12T14:44:25Z")

</div>

Collapse group ought to work. I use this feature extensively.

Here’s a quick example:  
[![CloudApp](https://dxc4e0vr313yq.cloudfront.net/production/t/40e4df447e9d/h200 "Screen Recording 2019-07-12 at 10.47.30.43 AM.mp4") ](https://cl.ly/40e4df447e9d)

---

<div class="post-metadata">

**Author:** ![anwarsby](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/anwarsby/32/24745_2.png) [@anwarsby](https://forum.bubble.io/u/anwarsby)\
**Post date:** [July 12, 2019, 2:46pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/7 "2019-07-12T14:46:07Z")

</div>

Hi,

Maybe you can try this.

Put rg in group, set the group collapses when hidden, then set conditional on the group when rg list of … count is 0, this group isn’t visible.

---

<div class="post-metadata">

**Author:** ![paulogustavopeixoto](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/paulogustavopeixoto/32/253627_2.png) [@paulogustavopeixoto](https://forum.bubble.io/u/paulogustavopeixoto)\
**Post date:** [July 12, 2019, 3:06pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/8 "2019-07-12T15:06:09Z")

</div>

I have tried it out but it does not work. I have seen somewhere that maybe if I have hidden elements on top of that group that may be the reason why it does not collapse.I dont know I really need this to work

---

<div class="post-metadata">

**Author:** ![robert](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/robert/32/149181_2.png) [@robert](https://forum.bubble.io/u/robert)\
**Post date:** [July 12, 2019, 3:13pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/9 "2019-07-12T15:13:01Z")

</div>

If there is an element to the side or on top (in the same vertical space) it won’t collapse that space (just hide the group). Check to see. If so, either redesign to get rid of it, or have it collapse as well.

---

<div class="post-metadata">

**Author:** ![robert](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/robert/32/149181_2.png) [@robert](https://forum.bubble.io/u/robert)\
**Post date:** [July 12, 2019, 3:19pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/10 "2019-07-12T15:19:00Z")

</div>

[![CloudApp](https://dxc4e0vr313yq.cloudfront.net/production/t/9100519c57d9/h200 "Screen Recording 2019-07-12 at 11.22.29.02 AM.mp4") ](https://cl.ly/9100519c57d9)

here is an example of a situation that could be causing the issue you are encountering

---

<div class="post-metadata">

**Author:** ![paulogustavopeixoto](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/paulogustavopeixoto/32/253627_2.png) [@paulogustavopeixoto](https://forum.bubble.io/u/paulogustavopeixoto)\
**Post date:** [July 12, 2019, 3:23pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/11 "2019-07-12T15:23:53Z")

</div>

I will give it a try

---

<div class="post-metadata">

**Author:** ![paulogustavopeixoto](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/paulogustavopeixoto/32/253627_2.png) [@paulogustavopeixoto](https://forum.bubble.io/u/paulogustavopeixoto)\
**Post date:** [July 12, 2019, 3:28pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/12 "2019-07-12T15:28:05Z")

</div>

It does work thanks but I still have on element which I cannot move which is a groupfocus and I am not able to collapse. Any idea how to do that?

---

<div class="post-metadata">

**Author:** ![robert](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/robert/32/149181_2.png) [@robert](https://forum.bubble.io/u/robert)\
**Post date:** [July 12, 2019, 3:38pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/13 "2019-07-12T15:38:15Z")

</div>

I’m sorry, but I’m not familiar with the Group Focus element, as I don’t use it.

I’ve found in these situations it is generally better to redesign things to work around these problems (i.e. can you do without the group focus?), rather than trying to force your way through Bubble’s limitations.

---

<div class="post-metadata">

**Author:** ![eli](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/eli/32/42610_2.png) [@eli](https://forum.bubble.io/u/eli)\
**Post date:** [July 12, 2019, 5:01pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/14 "2019-07-12T17:01:52Z")

</div>

A group focus floats above the page relevant to a particular element. It won’t impact the rest of the elements on the page.

---

<div class="post-metadata">

**Author:** ![paulogustavopeixoto](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/paulogustavopeixoto/32/253627_2.png) [@paulogustavopeixoto](https://forum.bubble.io/u/paulogustavopeixoto)\
**Post date:** [July 12, 2019, 8:35pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/15 "2019-07-12T20:35:09Z")

</div>

I have literally gone and checked all elements, and even though I managed to collapsed the element there is still a space that does not have any element in there and it is black. Breaking my patience into pieces haha

---

<div class="post-metadata">

**Author:** ![robert](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/robert/32/149181_2.png) [@robert](https://forum.bubble.io/u/robert)\
**Post date:** [September 4, 2020, 3:02am UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/16 "2020-09-04T03:02:22Z")

</div>

The solution is to put the repeating group into a group (usually of the same dimensions), and have that “container” group collapse when hidden.

---

<div class="post-metadata">

**Author:** ![anon38627393](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@anon38627393](https://forum.bubble.io/u/anon38627393)\
**Post date:** [October 2, 2020, 5:57pm UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/17 "2020-10-02T17:57:02Z")

</div>

While the “wrapper group” solution works most of the time for force-collapsing RG’s, there is actually a Bubble bug for RG’s that in some infrequent cases keeps the RG from collapsing when empty, even when wrapped in a collapsing wrapper-group. It took me _forever_ to figure this out.

If you run a counting conditional ANYWHERE on your page or in the active workflows against the RG, the RG will not collapse when empty. Simple as that. The fix is to change your counting conditional to the form of a :item# is not empty format and then it will collapse when empty. E.g. “if RG:count \> 5 do something” is the same as “if RG:item#6 is not empty do something”. I haven’t bother logged a bug on this simply because I don’t have the time to construct a extra-app example page for Bubble analysts to digest.

---

<div class="post-metadata">

**Author:** ![rosekherr](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@rosekherr](https://forum.bubble.io/u/rosekherr)\
**Post date:** [May 27, 2021, 3:06am UTC](https://forum.bubble.io/t/how-to-hide-repeating-group-if-empty/61520/18 "2021-05-27T03:06:55Z")

</div>

i was going crazy trying to figure out why my element wasn’t collapsing and THIS was why! thank you so much!
