Showing a placeholder in a RG where there is no data

Hi everyone, I’m just getting into bubble so I’m sorry if I’m being a bit naive. What I’m trying to do is this:

I have created a table with fields for Month, Year, etc so I’m happy that once the data is there I can create a RG and make it 1 row by 4 columns. I’ve tested it out and the conditional settings for setting the ‘status’ works a dream. But where I am struggling is this…

…I want to have the ‘placeholder’ image show up on the empty columns. Otherwise I’m going to have to create all of the data for every client by hand! I would like to be able to have an image that encourages them to click on it and fill in the data (which will auto populate the month/year). I’m happy with the data entry bit but I just can’t get the ‘placeholder’ image to show up.

I’ve tried ‘is empty’ conditions and all sorts but I can’t fill all 4 columns up. It must be so simple but I have missed something.

Help!!! Please!?!!

Looks like a great community here. I can do some basic code but this looks like an awesome product. Don’t flame me but it kinda reminds me of Microsoft Access back in the day!

Hi @paul4, welcome to Bubble!

The main thing to understand here is that a repeating group cell needs a data source. If the cell cannot reference a record, it will not be able to display anything (as you’ve seen), let alone display anything under a condition.

I see what you’re wanting to do though. Here is one solution…

There is a plugin called Toolbox that lets you generate a list of numbers (it’s an invisible element that you add to the page). You can define the list to be #1-4.

Set your RG’s type to number and set the source to this element’s value. Now, each cell has a data source: a number. Instead of the cell directly referencing a record in your database (to pull image, text fields, etc), the cell will need to search your database for that record with the number source as an identifier.

Example:
Group element inside the cell has type set to “Thing” and group’s source is set to Search for Thing’s :item #current cell’s number. Your image and text elements can then pull from the group using “parent group’s Thing’s [field]”

The biggest variable here is that search. A bunch of these searches on a single page might have a noticeable loading time. The search may need some other constraints. But hopefully this gives you something to work with.

I’ve seen other methods too like creating blank records, which also has its pros and cons.

Ultimately, to do the placeholder, you’ll have a condition on the image based on the source. In my example, if group’s Thing is empty > change image source to something static you upload. Or with the blank record example, if current cell’s Thing’s image is empty > change image source.

Hope this helps!


Gaby | Coaching Bubble
Private coaching, courses, and tons of free resources

1 Like

Wow, I wasn’t expecting such an amazingly well thought through response so quickly! Thanks so much! I’m glad it wasn’t just me missing something. Now you say it it seems obvious that if there is no data then it’s not ‘blank’ it’s just nothing! :lightbulb moment!

So to summarise, I think instead of making the RG source the database search, I actually make it a row of numbers using toolkit (1, 2, 3, 4), then in the cell create another group that has it’s data source as the database search. I’ll give it a go!

One question, you said about blank records? This could actually be a solution becuase I’m essentially creating 4 records per month so it’s not a bunch and a default ‘not used’ record for each of them is actually ok. Do you have any idea how I go about creating the blank records automagically? Maybe with a click of a button (generate a years worth?).

Again, thanks for the awesome answer, sorry for more questions! I’m really enjoying using bubble. I like the fact I can dive straight in then stop and re-start once I’ve figured it all out.

UPDATE: I did what you said. I think you might be a genius!!! THANKYOU!!!

Hi Gaby, great advise as always. I tried this solution as it was the one of all the posts in this forum that matched my problem the best, but I cannot make it work - probably it’s because my usecase is slightly different. I have been trying all and every solution I can think of and would appreciate your input. See below

I have a vertical RG “category” group - the red tiles. The big blue + buttons function is to add a new Category at the bottom of the stack. But inside the red vertical RG I have another horisontal RG “Content” (the white tiles) which datasource is current cells Content items Category. User will click on a Content tile and add title and other stuff via controls that are hidden until tiles is clicked. The tiles with dotted borders are blank records created by a workflow (initated by change of title value) that counts content tiles with no title and adds one if none is found - but it does not really work as you see in the top row

At the end of the day, all i really want to achieve is this: Every time the last “empty dotted tile” is populated with content, then create a new blank (dotted) tile at the end - and only one. This dotted empty tiles only function is to serve as a button to open controls to enter title and content.

So I tried you solution - setting my Content RG’s type to number and using Listofnumbers tool as datasource for one group within the RG. It works, but then I cannot figure out how to make another group have a datasource for fetching content from the DB. Every time i do a do-a-search for, I come up empty. How to do a do-a-search for that fetches all content items of a particular category?

Hey @carstenkring, try this…

Put the Content RG inside a group of its own with data source of current cell’s Category. Let’s call this group “Cell Category”

The Content RG’s source can still be the list of numbers.

But now, the inner groups have another element they can use to reference the category, and that is this new “Cell Category” group. Those inner groups can now do a search with constraint: Category = Cell Category’s Category.

Hope this makes sense!

1 Like

Made it work. Thank you so very much…

Tiles

1 Like

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