I am struggling to show all the results that meet my constraints in my Repetitive Group and have been spending hours looking for a way to do it on this forum but I couldn’t find the answers…
Basically, I am building an app that allows booking for certain type of classes. I thus have a “Class” data type containing a field “Date Hour” that is a list of Availabilities with a date field where I store all the different availability for this particular class.
I built a search page with different filters that are all working but the date one is not functionning… I have a calendar on which the users can click to select a date, that will then store a custom state called “Extract_Date”. From this custom state, I want to show in my repetitive group only the Classes that have an Availibility (Day Hour) on this day. (for instance, the user click on March 9, then if I have 4 classes that have an availibity on this date, I want these 4 classes to be shown in my repetitive group).
For now, I suceed to filter them but bubble forces me to select only the :first_item or :last_item or a random one but I would like to be able to see all of them… Below is a screenshot of my conditions:
Does someone has any idea on how to solve this? Maybe someone already answered this question and I didn’t see it in the forum? From all the questions I’ve seen maybe @adamhholmes or @boston85719 you have an idea?
Thank you very much in advance!!!
If bubble forces you to select first item or random item you are not using a repeating group.
Thank you for your feedback! I am not sure to understand what you mean? I do a “search for” classes in the Data source of a Repetitive Group, and in the constraints in the last row (see screenshot above) I would like to be able to show all the “Taller” that have in their “Disponibilidad” list a time that matches my Calendar (see the Search for below)
Do you see something I am doing wrong?
I was responding to that portion.
Anyway, set on data type a field for day which is type number. Use that in your constraint, not the date. Then you can filter by chosen day using day number . 0=Sunday, Monday=1. Up to Saturday=6
Indeed I tried this method, however, I was then facing the exact same issue as I would put this constraint based on the day number in my second “Search for” but bubble will still show only 1 class in my repetitive group for all the classes since I will still have to select the :First Item or :Last item in the last row of my first search research
Hello. When you click on a calendar date, you retrieve it (the date) in a custom state, right?
you are therefore going to put a condition on your repeating group… you will tell it : when custom element’s Extract_Date is not empty
you select the property “data source” and you set it like : search for Tallers (you apply all constraints of your initial search. Don’t forget to check the “ignore empty constraint”)filtered (with filtered you can do advanced searches)
a window to make your filter will be displayed and there you can choose advanced as an option before applying your condition which will be : search for Tallers:each item’s disponibilidad contains “custom element” Extracted_Date
Or you can directly add your filtered on your initial repeating group data source
Hey! Serendipity abounds. Having the exact same issue as the OP, driving me nuts. Trying to search for activities where a list of the Activity’s Club Segments contains any of the list of segments that are attached to a user.
Bubble lets me search for where the Club Segments contains (e.g.) the first User’s Segment, same as the OP, but won’t check against the full list.
I tried adding a filter to the search per suggestion above but the exact same constraints apply.
Again, if you are needing to select first item or random item you are not doing your search in a repeating group.
But looking at your screen shot from first post, I can see you are attempting to use a search in a constraint.
If you need to use a search in your constraint as you are for Disponibilidad, your field of Disponibilidad needs to be a list for you to not need to select first item or random item.
So, looks like your database is not setup as you thought it was when you mention
…that is because if the field is a single item, Bubble will force you to select a single item from a search, but if the field is a list, then Bubble will not force you to select a single item.
Also, if it was a list field, you’d have a comparative contains list, not contains.
Check your database structure.
If the database structure is correct, then you might need to add the :filtered operator after the original search to use the Advanced Filter.
Using a list of things to compare against a list of things in Bubble always requires the use of the Advanced Filter which is only accessible using the :filtered operator.
Thank you for your feedbacks @boston85719 & @WILSON!!
The field Disponibilidad (part of Taller) is indeed a list (see screenshot below), it is composed of different Day_Hour that are basically availabilities (and of course I can have many availabilities for each Taller.
@WILSON Indeed I am retrieving the date in a custom state, and I would like to get in my Repetitive Group all the Taller that have in their availabilities at least 1 that matches the date that was picked (I am using the availability date>custom state date and availability date<custom state date + day 1 so that I won’t have issues with the time but will only look at the day.
I tried with both the advanced filter as well as the condition but for both I am still stuck with the same issue, bubble is showing me results in my repetitive group only when there is 1 taller that meets the criteria and no results when there are 2 or more taller that meet the criterias (and thus that should appear)…
Indeed, I am not looking to compare a list with a list, but I have a date saved and I want to check in a list if there is at least 1 result that has a similar day, and show all the values for which it is the case in a repetiting group
Maybe I am doing something wrong?
Every date object in Bubble has a time associated with it, and that is true for dates chosen by a date picker…the native bubble date/time picker has two options, date only or date/time…if the element is set up for date only, when the user selects a date from the date picker, it is NOT just a date, but it still also contains a time element component which is 12:00AM.
What might be happening is that the time component of 12:00AM is messing with your constraints.
I would do what I mentioned previously and setup a field of day of week as a number which would then allow you to have a user select a date from the date picker and save to the custom state the extracted day value (numbers 0-6).
One thing to keep in mind, dates are nothing but numbers…in Bubble it is the number of milliseconds since ‘epoch’ time or as I call it ‘dawn of computer time’…Jan 1, 1970 12:00AM UTC
Yes I understand what you mean, just created it but when I want to look in the List of Availabilities if there are any that have the same day value (0-6), it still asks me to put :first item… I am still not able to search in all my classes, if there are some that have an availability that has a day value 0-6 that is similar to the day value I saved in the custom state when the user selected a date from the date picker
Look back at previous replies and use the :filtered operator and Advance Filter
my search looks like this:
Search for Class: each item’s Availability contains search for Availability
In the second search I write down that the day number = day number of my custom state
but here bubble asks me to select either first or last item
I would like to understand something. the dates of availability of your classes. it is a defined period like dev nocode class from march 09 to 13 or it is random dates for example: dev nocode class on march 09, 11 and 26.
This information will help me solve your problem.
i dit this test app for a similar subject. You can check it and let me know if it helps you.
This topic was automatically closed after 70 days. New replies are no longer allowed.