Nested repeating groups?

Hi all,

Few weeks into my Bubble journey and building an appointment scheduling app…

I currently have an appointments screen built using a repeating group that looks like…

I think it would look a lot better if it looked something like this…

I’m thinking maybe a nested repeating group - but not sure where to start? My DB is very basic at the moment - just a single table…

Would I be right in thinking there’s a 1:1 relationship between rows in my DB table and rows in my RG and there’s no way round this except to restructure my data so I’ve got a table with one row for each day (hooked up to an outer RG) and another table of appointment times for each day (hooked up to a RG nested inside each row of the outer RG)? Or am I barking up the wrong tree? I know my existing DB design isn’t up to much, but something tells me I shouldn’t have to redesign the DB to suit the UI?

Any steer in the right direction would be greatly appreciated!

P.S. data in screen shots is dummy data…

Thanks!

dB structure is pretty much the app :grinning:

I would submit that the UI should be designed to fit the experience you want your users to have

1 Like

Hey @apmcintyre

Definitely agree with Carlos, your DB design will determine whether implementing a certain UI feature will be easy or difficult.

The appointments data type already contains a date field, so we can just “pivot” on that date to group the appointments. No need to create two separate data types. Yes, nested RGs are the way to go. It’s not super intuitive so I’ve made a small demo (link) you can follow to see how its done.

Not necessarily. An RG just displays a list. You can tweak that list before displaying it. For example your source for the RG can search for appointments where the date is prior to the current date. That will result in fewer rows returned compared with the full DB records.

Sometimes you will need to change your DB structure to accommodate a certain layout / feature, but general search performance needs to be considered too.

Hope that helps!

Rob

5 Likes

Many thanks for your idea Rob and the sample app - it looks to be just what I need. I’ll take a closer look on my laptop tomorrow.

I agree with both yourself and Carlos… I’m new to Bubble but have done some traditional coding in the past. With Java for example, you can pretty much massage your data into whatever you want on the front end regardless of what it looks like at the back end. With Bubble it looks like your data is more closely coupled to your UI so you need to be a bit more careful!

Anyway, it’s been a fun journey so far and certainly reinvigorated my interest in programming (Oops! I know it’s no-code, can I still say that? :joy:)

Alan

3 Likes

Thanks to @robhblake have achieved what I wanted to do… just a bit of tidying up required.

Alan

2 Likes

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