# Display a message when an element in a collection list is empty

**URL:** <https://community.weweb.io/t/display-a-message-when-an-element-in-a-collection-list-is-empty/7059>\
**Category:** How do I?\
**Created:** [February 16, 2024, 2:25am UTC](https://community.weweb.io/t/display-a-message-when-an-element-in-a-collection-list-is-empty/7059 "2024-02-16T02:25:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SteveB](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@SteveB](https://community.weweb.io/u/SteveB)\
**Post date:** [February 16, 2024, 2:25am UTC](https://community.weweb.io/t/display-a-message-when-an-element-in-a-collection-list-is-empty/7059/1 "2024-02-16T02:25:48Z")

</div>

I have a collection list which holds a repeating group. Is there a way to display a message when there are no items in the enclosed repeating group? Hopefully the image below will help explain the question:

 ![Screenshot 2024-02-15 at 8.19.56 PM](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/c/cc138bc7655f7faaaa35bb7f1e57e1bf51951ccf.png)

Thanks!

---

<div class="post-metadata">

**Author:** ![jptrinh](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/jptrinh/32/1493_2.png) [@jptrinh](https://community.weweb.io/u/jptrinh)\
**Post date:** [February 16, 2024, 9:32am UTC](https://community.weweb.io/t/display-a-message-when-an-element-in-a-collection-list-is-empty/7059/2 "2024-02-16T09:32:22Z")

</div>

Hey @SteveB !

You can create a new component — a sibling element to your collection — and add a conditional rendering on it. The condition should be bound to the collection list length: if the collection length is less than 1 (or equal to zero), then display the element.

Hope that helps 🙂

---

<div class="post-metadata">

**Author:** ![SteveB](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@SteveB](https://community.weweb.io/u/SteveB)\
**Post date:** [February 19, 2024, 12:40am UTC](https://community.weweb.io/t/display-a-message-when-an-element-in-a-collection-list-is-empty/7059/3 "2024-02-19T00:40:56Z")

</div>

Thanks for the suggestion Jean-Philippe. I’m sorry to say I couldn’t make it work. When I made a sibling of the repeating group it would never show (of course because if there were no items there was nothing to repeat). When I tried at the collection level, I could not “see” the index of the repeating group. I tried a no code formula to duplicate the array processing but got a list of objects which I couldn’t figure out how to count … looked like this “[Object, object], [Object, object]”. If you have any suggestions I’d be grateful.

Thanks no matter.

Best regards,

Steve

---

<div class="post-metadata">

**Author:** ![jptrinh](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/jptrinh/32/1493_2.png) [@jptrinh](https://community.weweb.io/u/jptrinh)\
**Post date:** [February 19, 2024, 6:58am UTC](https://community.weweb.io/t/display-a-message-when-an-element-in-a-collection-list-is-empty/7059/4 "2024-02-19T06:58:24Z")

</div>

The empty state div should be outside of the repeating group — a completely separate element.  
And on its conditional rendering option, you can still refer to the collection properties. Here’s a quick demo to make it a bit clearer.
