I’m guessing a lot of you have struggled down the same path dealing with populating empty repeating groups? I finally got some feedback from Bubble that clarifies things, but the rationale feels completely arbitrary.
So, when it comes to RGs it turns out there is not one kind of “empty”. There are actually 2 kinds of empty: empty in the database, and empty in the repeating group.
If the database is empty, then you cannot control what is displayed in the RG. It’s a tremendous oversight if you ask me, but I also know that I am only one use-case and an outlier at that. So, maybe this actually makes sense to everyone else?
Not sure how other folks feel, but I am way past frustrated on this. Empty is an absolute condition, if the repeating group is empty because the database is empty, it doesn’t mean that the repeating group isn’t empty.
I requested an explicit feature to provide a direct solution because I have spent months slamming my head against this. But maybe I’m just thinking in the wrong direction. . .
I’m not sure I fully understand what this post is about (so maybe I’m missing something), but what exactly would you expect, or want, to display in a RG if there’s no data in the database?
Can you explain a bit about your use case so I (or anyone else) can try and understand what you’re trying to do?..
On my app you can find skateparks in LA. The skatepark viewer page has RGs to highlight local community leaders, and local participants at the park. The local leaders take ownership of the scene in the app, and then they add locals.
I have conditionals set up to count the number of local leaders and locals, and when either of them are less than 1, there is purposeful dummy info that displays. But the dummy info is not displaying. Of course I could collapse and hide these groups, but if they’re empty I want to prompt people to claim them, and if they’re hidden that can’t happen.
When I checked the inspector, a park with no local leader in my database, and no dummy info in my RGs, was showing what appeared to be 2 local leaders–but they were not local leaders that actually exist in my database.
So, I reached out to Bubble with a Bug report. And then i got an email from support that said a repeating group that searches the database and finds no results will bypass a conditional that queries the database for a count of zero.
So, if you tell the RG to check the database and count the entries, and display an image if the database has zero entries, and the database is empty, it will not display the zero count image–instead it will just be an empty RG.
I try to put my logic closest to the elements I’m interacting with. With that in mind, have the condition consider the RG list of things. “when RG’s list of things is empty…” I don’t know what that means for your other conditionals on leaders etc.
Edit:
Sorry, “when RG’s list of things is empty…” isn’t an option
how about “when RG’s list of things :count is empty…” or “when RG’s list of things :first item is empty…”
Are you saying “… :count is empty” didn’t work?
Exactly - a Repeating Group displays lists of data - if there’s no data then there’s nothing to display (conditionals or not).
To achieve what you’re trying to do you can just use a regular group, to display static images and dummy data when the RG datasource is empty.
Alternatively, why not create the ‘dummy’ data in the database (with a field to mark it as dummy data), and set the RG datasource conditionally to show the dummy data when there’s no other data to show.