# Conditional for Data Source on Reusables

**URL:** <https://forum.bubble.io/t/conditional-for-data-source-on-reusables/391271>\
**Category:** Tips\
**Created:** [February 14, 2026, 10:19am UTC](https://forum.bubble.io/t/conditional-for-data-source-on-reusables/391271 "2026-02-14T10:19:33Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![boston85719](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/boston85719/32/77286_2.png) [@boston85719](https://forum.bubble.io/u/boston85719)\
**Post date:** [February 14, 2026, 5:11pm UTC](https://forum.bubble.io/t/conditional-for-data-source-on-reusables/391271/7 "2026-02-14T17:11:57Z")

</div>

> [@georgecollier](#):
>
> Keep in mind that Bubble only fetches the data when it’s needed, so if it is being fetched, it’s because some combination of stuff in the app references that property and needs the value to evaluate on page load

Yes…this is to ensure Bubble knows it is only needed when the reusable is visible, hence the use of conditions to give Bubble that instruction. Otherwise, if for example you have a repeating group inside of the reusable element that just simply has the data source set in default data source area, that data will get fetched even if the reusable is not visible on the page. Also, if there is a text element referencing the repeating group, even if that repeating group has a data source set conditionally for only when the reusable is visible, the text element will cause the aggregate search to have the count, so again, needing to give Bubble the instructions via the condition not to do that unless the reusable is visible, because the reusable is on the page, but just not visible due to the fact the navigation url parameter doesn’t have that ‘view’ open.

> [@senecadatabase](#):
>
> if a user then browsed to a different group, wouldn’t that make the reusable not visible anymore?

yes

> [@senecadatabase](#):
>
> And if they came back to that reusable, it would do a search all over again?

if it is just a basic do a search without constraints, no, it would use the previously fetched data. If however, it has constraints, it depends on how those constraints may have changed.

> [@senecadatabase](#):
>
> On my SPA, when get data from page url is products (example), I load a custom state with a list of those products only if it is empty, then set the RG’s source as that custom state. The user can browse the site all day and the custom state stays. This does one loading and there’s no need to repeat it.

So long as you are always using ‘go to page’ action and it is the same page as your SPA would be, then custom states are not lost…however, there is no material benefit to adding the usage of a custom state to hold onto the list of products. You can instead just put them into the repeating group via a search. And if the repeating group is not set to show all items immediately, you may see WU savings this way, since I’d imagine the approach implement with custom state was to fetch ALL products…if search is directly in the RG and not set to show all items immediately, you will not actually fetch all products.

@georgecollier had a tip about understanding where data comes from that gave some decent insights [Understanding how searches and filters work in Bubble](https://forum.bubble.io/t/understanding-how-searches-and-filters-work-in-bubble/388905)

What those insights help understand is with bubble lazy loading, if the user doesn’t scroll past first set of results batched in first fetch, you are not fetching all products. In my db, i get around 35 returned on a blank page, with one rg, with products that have 3 fields plus the built in fields.

> [@senecadatabase](#):
>
> So basically, the custom state never loads unless that url is called.

Yes, that is good, but likely you are loading all search results into the custom state.

> [@senecadatabase](#):
>
> It seems is visible etc. can have a lot of hidden gotchas that can be easily overlooked.

Not that I am aware of

> [@senecadatabase](#):
>
> Anyway, do you see a flaw with my method?

Just what I presume to be a fetch of all products to set the custom state list of products

---

_[View the full topic](https://forum.bubble.io/t/conditional-for-data-source-on-reusables/391271)._
