Creating a RG for a list of Dates pulled from Date Fields

I can’t figure out the logic of how to get this to work.

I want a list of dates I will have notifications going out for each event. Trying to avoid sending to many event notifications on the same days. So the list would show Event and date, sorted by date.

My current setup.
I have Event data type, and in the event field I have 2 announcement dates. Announcement 1 and Announcement 2. Sometimes those are empty if I don’t have a scheduled announcement.
I want a RG that will show the list, but not sure what to have for the Data Source. Not sure if a Grouping would work to get a list of events by Announcement dates. If an event has 2 announcements 1 & 2 filled it it would appear on the list twice.

Does this make sense? How would I set this up?

I think the way to approach it is by creating a new type (“Event” field, “Date” field) and have a RG that merges 2 searches. The first search is by date 1, second by date 2, then sort them by date.

Sorry, I’m not following. Why would I need to create another Data Type? Am I not able to do it with what I already have?

You can, but I think you’ll have a problem to determine which announcement should you relate to, when going over the list, unless you add a condition that checks if the date has passed

OK, I decided to separate the Announcement 1 and Announcement 2. I did a RG to find the dates. Then did nested RG inside looking for events with Announcement’s 1’s date. Seems to work with dates, but no events are showing up. Any thoughts on why the events are not appearing?

OK, figured out what was going on it was looking for an exact date and time. I found a solution, but not sure if it is the best solution.

I’m a little lost reading your explanation, is your goal to have the two separate repeating groups or you want them combined? I guess if your advanced filters all work then it should be fine but I’m just seeing if there’s another way

Seems like you just want a list of dates, not the actual Event data themselves? You could just do a repeating group with the type “date” and data source being this:

Might need to add a :unique items in front of the :sorted

I would prefer it to be one list showing events for the 2 announcements. If the content type is Data I wonder if it would make it harder to display the event info? I like displaying the event where I’m able to click on the event to go to the event edit page. I might also add the ability to change the Announcement Date directly from this page so I don’t have to go to the event page.

Okay so since it’s one list that means if you had an event announcement 1 on 12/1 and announcement 2 on 12/3, the same event would show up twice if that’s fine? Sorry it’s not making sense (to me) because if you have two dates fields you can’t sort by both at the same time of course, and if you want to show both announcement dates you would need it to show up twice in your single list

Just tried something on my test app and I forgot Bubble does funny things by not showing duplicate items, which would effect your case.

You actually might benefit for performance reasons to making another data type called “Announcement” with a field for Exact date, another for Rounded down date, and “Event” with the type Event. And you could in the future make more than just two announcements. And each announcement could have it’s own text field for a email subject line, etc.

Then you just do a repeating group searching for Announcements sorted by date and inside the cell have a button to go to the Event, and some date/time pickers to edit the announcement’s date.

Yes, if an event has two announcements, one for Announcement 1 and one for announcement 2 it should show up in the list twice.

I thought I could make a RG which does a search for events, merges dates for both announcement 1 and 2, and then merge of the two Advanced searches, but that did not work either. Seems the only way without adding new fields is keeping the lists separate, or another way we’ve not figured out yet.

Yea I’m trying to stay away from the advanced filters because as you get more and more events in your database the performance will tank. On the client side it has to download every event, then filter through it VS using search constraints where the server just instantly finds results and sends them to the client.

The date repeating group I proposed earlier, you can keep that. Then inside the cell add another repeating group type Event, and do Do a search for Event with the Advanced filter: This event's Announcement 1 date:rounded down to date = Current cells date or This event's Announcement 2 date:rounded down to date = Current cells date

That would work but its a lot of filtering and will be a lot slower over time