Display multiple entries in repeating group

Hello

I’m trying to display paid bills in a repeating group, but only those that match the current month. I have created a state that displays the month and year like this: December 2023.

Here is my setup:

Here is how Bill Paid is stored in the database:
Screenshot 2023-12-28 192028
The field can store multiple entries.

How can I also consider the bill to be paid if the last paid date was within 30 days?

Thanks!

I tried to solve your problem with your current design (Paid On is a list of dates) but nothing useful so far.

If I may suggest a design change (just one new field), it would be extremely easy though. I am assuming whenever a bill is paid, you add another date to this (paid on) field of the bill. If you add another field called Last Paid On which is just a date and is updated whenever the bill is paid and always keeps the last date the bill is paid on. The logic you have designed would work perfectly (but using the Last PAid On field). You will still continue to add the payment dates to the list of dates field called Paid On. And whenever you add something to this list, you also set the LAst Paid On field.

Here is the data:

And here is the bill pay button workflow:

And your repeating group can easily show the last 30 days with this data:

And the repeating group:

And the final result:
image

But what if the user decides to go back three months on the month switcher to see which bills were paid on what date of the currently selected month? So that’s why I wanted to store multiple entries of the bill paid date. And then just use this to show them.

Screenshot 2023-12-29 112000

I also can’t understand why this function is not working. Like it should match dates that are stored in database with the currentMonth state which is displayed like this : December 2023, that’s why I used rounded down to month

In your case, you are right. Even my approach won’t work.

But the reason your approach doesn’t work is hidden in the contains function. It tries to find an exact match, not looking for a range. That’s why it cant find it.

If you are willing to change your design a little bit, here is the solution I have found. The basic idea is to make the paid on a single field instead of a list. So, I made another type called Payment which links to the Bill itself. And the Bill has a list of Payments.

Here is how the data diagram looks like:
image

Here is Bill in Bubble:

And here is Bill Payment in Bubble:

Now, whenever a bill is paid, a new Bill Payment will be created with a link to the original bill and this payment is added to the payments link of the bill:


After saving these and making the links successfully. The rest is easy. I have created the following UI in bubble to show all the bills and their payments in nested repeating groups:

And then, here comes your part. Filtering and showing the bills paid on the month of the selected date.
repeating group filter

And here is the design of that repeating group, which filters out the bills with payments in that month.

@Daniel90 were the solutions provided in the other post of yours not sufficient?

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