How to Show a "No Results Found" for a Repeating Group?

Hello! Running into a small issue that will hopefully be helpful for others if we can solve it.

I have a repeating group that shows a bunch of deals from restaurants. What I would like to do is show a “No results found” text if there’s no results.

My first though was to just use the count of the elements in the repeating group as a condition (when RepeatingGroup meal-deal’s List of meal-deals:count is 0). This caused a problem though, because there’s a second or two when the page loads and the search is happening, so the text shows then too.

Any ideas?

@callen.hedglen - the zero count logic that you mentioned is what I’m in favor of using most. (Ie. directly referencing the repeating group). That way, if I have user-facing filters/constraints on the search, it also shows up as they are applied.

If the group itself takes a bit of time to load, it may be worth working in some sort of initial loading icon.

As well, you can apply inverse zero count logic to the repeating group itself so it is only visible when there are results to display. (Ie. set up the data source for the repeating group as a conditional that displays only when the count > 0…and not as initial content. Then have a second condition that also has the repeating group hidden either when the search count is 0 or your message for the zero count logic is visible).

I can’t say that I’ve tested how it actually impacts performance. (Will happily have others chime in). But seems smooth enough from my testing to be good from a user standpoint.

Thanks for the input @dan1 ! Applying the zero count login on the actual repeating group is a great idea.

I actually do have a loading icon as well - I didn’t state it earlier, but this was also part of the problem. How can I show the loading icon, but not the “No results found”? It seems like they would have the same conditional logic.

Thanks!

Condition on text such that when loading icon is visible this text is not visible.

You could also AND that:

When condition1-for-showing-text AND loading-icon is not visible… this text is visible

Second to @keith’s suggestions :slight_smile:

1 Like

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