I am trying to find a simple solution to show a message when the user searches the database. This is a large dataset so I cannot use a plugin.
I have seen some suggest to show a message which hides when the RG has results, which is fine but I don’t know how to handle when it doesn’t return any results. The is loading doesn’t work from my tests and I really don’t want to fake it by setting a timer.
Any ideas would be appreciated.
Have you used Bubble’s built-in conditional visibility feature, you can create a text element that displays your message (e.g., “No results found”) and set its visibility condition based on the number of results returned by the database search. If the search returns any results, make the message element invisible; otherwise, make it visible.
You can do this by setting the visibility condition of the message element to “When [Search Result’s count] is 0.” This solution doesn’t rely on timers or fake loading states, providing a simple and efficient way to handle the scenario.
The problem is that there is a delay from the RG loading the results to displaying them or none. I can’t just show “No results found” when the RG has zero results found. I guess I could do a conditional with the same search returning a count of the results, but that doesn’t seam very efficient when you are basically doing the same query twice, once for the RG and once for the message.
Did you ever figure out a good solution for this?
Unfortunately no. I tried a number of work arounds but none are really any good. When I have some time I will dive into the network debug to see if I can add a custom Javascript event when data is loaded.