How to check the previous cell['s element] of a repeating group or check for duplicate text among cells

Hello bubblers,

I am making an event / calendar app and I’m having trouble figuring out how to properly display the events. My goal is to have them displayed similar to the image below, with the date only appearing once over the group of events in that date.

image

I’m trying to do this by having a repeating group, where each cell has the date and event details being displayed, but I only want the event date to be displayed if it is the first time that text is appearing, and not over every single event.


I’m not completely sure how to do this but I have an idea of what I want to do. I’m thinking of different options, both quite similar.
A. Is to make a conditional where the date is only visible if the same text box in the previous cell is not the same text, but I’m not sure that there is a way to access elements from the previous cell.
B. (which is still similar to A) By making a conditional that when the current cells date is not the same as the previous cells date, then the text is visible.

Again, I have an idea of what I need to do but can’t fully grasp how to do so. If any of you know any other, more practical options, I’m grateful for any suggestions.

1 Like

I would approach this differently.

  1. Create a repeating group where the source is unique dates of the events.
  2. Text to be displayed in the RG cells is the date
  3. Add another repeating group inside of the first one where the source is the events
  4. Add a constraint to the inside repeating group for the event date = parent cells date

Try that out and let me know.

Tal
Learn no code → Nocodify.com

2 Likes

Yup! Great suggestion @talbotnar

:point_up_2::point_up_2::point_up_2::point_up_2:

If you need a clue setting it up, check out this template calendar from @gf_wolfer

You could then have a nested RG in each cell of the calendar that does a search constrained by that cels date as a minimum and that date + 1 day as a maximum

2 Likes

Similar to what @Nocodify mentioned, but I would actually make the parent / main repeating group a list of Texts, not Dates. Just because dates are so precise in Bubble that even if they fall on the same day but a different time, it would be showing as a different date.

  1. Repeating Group
    Type: Text
    Source: Event List’s Dates:sorted :formatted as mm/DD/yyyy :unique elements

  2. A nested repeating group within the cell
    Type: Event
    Source: Event List:filtered (this Events date :formatted as mm/DD/yyyy is current cell’s Text)

2 Likes

Thanks so much to all of you!
I started off with @Nocodify’s suggestion with the nested repeating groups but ended up using @gf_wolfer’s method which was a bit simpler and worked great. I also ended up doing something similar to what you said, @jared.gibb, but instead of +1 day as a maximum (because I’m having the repeated group span over a whole week using this day of the week plugin) I used the last day of the week but changed the hour to 23, minutes to 59, and seconds to 59.
Again, thanks to all of you for you help on this!

1 Like

Hey :slight_smile:

I think it’s better to avoid nested RG for the performance…

  • The date of a cell is only show if the date is differents from the previous cell
    • The index of the last cell is in this element: :1234: index last cell + Group Responsive left vertical padding

Cheers :sunny:
Arnaud

2 Likes

Can you explain a bit more on how to store and get the index of last cell?

Hey @net-tt,

  1. Get the previous cell number: “Current celle:index - 1
  2. Get the content of the previous cell: “RG:item X”

Hope it help

1 Like

Thanks!

1 Like