# Condition to display icons based on files saved in the database does not work

**URL:** <https://forum.bubble.io/t/condition-to-display-icons-based-on-files-saved-in-the-database-does-not-work/348540>\
**Category:** Need help\
**Created:** [November 15, 2024, 8:22pm UTC](https://forum.bubble.io/t/condition-to-display-icons-based-on-files-saved-in-the-database-does-not-work/348540 "2024-11-15T20:22:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonardobelizario88](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/leonardobelizario88/32/235263_2.png) [@leonardobelizario88](https://forum.bubble.io/u/leonardobelizario88)\
**Post date:** [November 15, 2024, 8:22pm UTC](https://forum.bubble.io/t/condition-to-display-icons-based-on-files-saved-in-the-database-does-not-work/348540/1 "2024-11-15T20:22:08Z")

</div>

Hello everyone, I’ve already made several queries to GPT, Doc and videos on ytb but I still haven’t been able to figure out why when placing a condition on icons so that they only display if there is a file saved in the documents field of the units table. In this table I have 1 field that receives a list of documents. I have a repeater group and I want to display the icon based on that. If there are documents, display a green icon, if there are not, display red.  
I created 2 conditions so that it would check in the database if documents count \> 0 and document is 0 to display the red icon.  
I have already examined the repeating group and it does not bring the documents, only the other fields.

 ![print1](https://us1.discourse-cdn.com/bubble/original/3X/6/b/6b4667e41d5db6c9cd402145d31ffbd219c00220.png)  
 ![print2](https://us1.discourse-cdn.com/bubble/original/3X/3/6/3674d89b91dd9b5f9e4d8ff656db418a3897415d.png)  
 ![print3](https://us1.discourse-cdn.com/bubble/original/3X/1/4/149e1b060bc9216b1b4c76c31434fb73b3a8df28.png)

---

<div class="post-metadata">

**Author:** ![krenkel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/krenkel/32/213647_2.png) [@krenkel](https://forum.bubble.io/u/krenkel)\
**Post date:** [November 15, 2024, 11:22pm UTC](https://forum.bubble.io/t/condition-to-display-icons-based-on-files-saved-in-the-database-does-not-work/348540/2 "2024-11-15T23:22:24Z")

</div>

Hi, @leonardobelizario88, I believe that where you are writing when in the conditional, it needs to be search for units \> 0, in that line because you need to check with the database and not in the visual element.

---

<div class="post-metadata">

**Author:** ![gloriaui](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gloriaui/32/238496_2.png) [@gloriaui](https://forum.bubble.io/u/gloriaui)\
**Post date:** [November 27, 2024, 1:27pm UTC](https://forum.bubble.io/t/condition-to-display-icons-based-on-files-saved-in-the-database-does-not-work/348540/3 "2024-11-27T13:27:41Z")

</div>

Hi @leonardobelizario88

Check the icon, in the layout tab, if the option “collapse when wide” is checked. And the option “This element is visible on page load” must be unchecked.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/0/3/0367e173a668e2f91e54cfbd3082c48dbc61fe01.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [January 24, 2025, 8:22pm UTC](https://forum.bubble.io/t/condition-to-display-icons-based-on-files-saved-in-the-database-does-not-work/348540/4 "2025-01-24T20:22:28Z")

</div>

Closed on January 24, 2025, 8:22pm UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
