Forum Academy Marketplace Showcase Pricing Features

Avoiding setting up a repeating group within a repeating group

Hi!

I’ve created a repeating group as shown below:

What I now want to do is have it so that when you click the cell with full date displayed (Cell 1 - e.g. September 10th), all jobs on that date are hidden (Cell 1, 2 and 3), however I am really struggling with finding a method that allows this? It’s difficult to have subsequent cells reference the previous cells in a dynamic manner.

I realise another way I could do this is to reorganise the whole thing as a repeating group (a group of jobs) within a repeating group (a group of dates) - is this a better idea? I always worry that it’s going to result in high volume searches and slow the app down, so I always try to avoid this pattern out of habit.

Thanks for your help!

Just to understand a bit better, you’re looking to have all your dates present, and then when you click on a given date, all jobs of that date are then shown underneath it?

Hi @calmorrison, thanks for your reply

Close, I have all dates with jobs on, and those jobs, visible by default.

Clicking on the full date results in any jobs on that date being hidden.

What I am finding is that with my set up, I am only able to hide the content in the same cell. I have tried some really elaborate methods of accessing the other cell using hidden variables and the cell index, but not come up with anything that works well.

Oh I see you so you want to be able to click a date and then hide those jobs, correct?

That’s correct.

What I have used in the past, and seems to work great for me is using a nested repeating group with all the jobs within a dates cell. If you put that repeating group of jobs within a group, you can check “Collapse this elements height when hidden” and then if you wish check “Animate the collapse operation” to make it slide smoother. Have this group visible by default if you wish to have all the jobs visible. Then create a workflow so that when you click on the date, you “toggle” the group that contains the repeating group of jobs. This will achieve exactly what you’re looking for! As long as everything is kept modest you shouldn’t really have any performance issues at all, but if that is the case we can reevaluate! If you need a hand implementing just let me know!

Thanks for your advice - yes I figured this was one way to approach it… but was resisting! I am sure there must be a way to use one repeating group in this case… but it escapes me! :sweat_smile:

I won’t give up just yet… but thank you for the kind offer… I may take you up on it!

If you’re resistant to using a sub repeating group, let me think about it there may be a way. However just be cautious, a different solution may end up over complicating it and negating the performance hit of a sub repeating group. Just to get a better idea can you send a screenshot of how the repeating group is set up right now?

That’s also what I am starting to think, Cal!

I am not very experienced with Bubble but I read Peter Amelie’s notes about performance, and was enjoying the challenge of trying to do this without using a nested repeating group! Thought I might learn something!

Does this help?


Orange = each cell of the RG
Blue = groups within the RG

Left of image is a hidden var I created which records the time in the previous cell, I then use this as a point of comparison in the current cell, when there is a match I set the visibility of the Group for date title to off (thus getting the pattern I wanted earlier).

However, now that I want to hide all groups with the same date, when that date is clicked, it’s getting a lot more complicated.

I wonder if there is a similar method, where I can somehow get the subsequent cells to refer to cell with the date title’s visibility - but no luck so far.

Because it’s a weekly view only, another idea I had was to create a list of days which are currently set to hidden (for example as a state on the RG; such as a list of texts M, T, W, T, F, S, S), and set any cells with a day that matches to be invisible. However, I struggled to find a way to make a comparison between days of the week and the actual dates recorded in the db.

That’s basically where I am at!

Like you say it might not be worth it, but I guess I am like a dog with a bone now and can’t quit!

Here is a possible solution to try out, food for thought. Create a hidden group on the page which data source is your jobs. This group then does a search for the jobs for that week. Then create a repeating group for each of your 7 days, so it would have a fixed length of 7. In that cell for the date you would have “the date you wanted to show for that week + current cell index in days- 1 day” (since I believe bubble repeating groups index start at 1). Then create a group within that cell that is visible by default that holds a nested repeating group that displays all of the jobs for that day. The trick here is that we wouldn’t be running a search for on the database for jobs for that day we would just reference the data we have retrieved in that hidden group and filter it to only be the jobs for that day. Then simply add a workflow so that when you click on the day you “toggle” that group that displays the jobs, making it possible to collapse them. This should work, however I haven’t implemented something like this so I am not sure how efficient it would be compared to other solutions. There’s a bit going on, but we’re only ever actually making a search in the database for jobs one time (for the hidden group) and the other repeating groups for each day is just referencing that data that’s already on the page with a filter. What are your thoughts?

1 Like

Hi Cal,

Interesting idea, and may be more efficient than what I did. In the end I went RG in RG but it seems okay. I will have to try this method when the app gets clunky and see if performance improves!

In the end what I did was:

  • Generate a list of dates for the days of the week of a given week
  • Created a repeating group of that list of dates (with visibility off by default, but set to appear if the result of a search found an event that day)
  • Placed a repeating group within the cell of the above repeating group of events for that day

Thanks for your advice - it does seem like it would work

Instead of a nested repeating group you could have a text element that is setup to display a list of things and use the join with operator and use ‘line_break’ so that the individual items from the list are on separate lines.

Would the text element be for the list of dates or the list of events?

I am using Canvas at the moment, and often the design of the templates feel geared towards RGs!

You need at least one repeating group…i suggested no need for nested repeating group.

I would put the list of dates in RG and have the list of events in the text element. Be aware though that the events will not be clickable since it is just a text element containing a list of things…could not click and specify one individual event.

I see, yes… I think given the nature of this app, I’d need to be able to select the event so this isn’t an option in this case. Thanks for your input though!