All Collections
Troubleshooting
Why does the random operator return the same results each time?
Why does the random operator return the same results each time?
Updated over a week ago

When using a random sorting function you may notice that you're getting the same results each time. This is because Bubble caches the results of the first sorting order (meaning the results that were returned the first time you ran the random function within the same action or workflow).

To work around this, you can tweak your search queries slightly to 'break' this cache. For instance, you can add a simple, varying condition to each search, such as โ€œid <> random_value,โ€ where "random_value" changes with each search. This small change won't affect the essence of your search but will help in fetching genuinely random results each time.

Did this answer your question?