"Search for" in conditionals in repeating group... takes too long

Hi guys,

So I’ve been toying with this for quite some time now. What I am trying to do is to create a simple calendar view list with daily tasks/habits: (see screenshots) the user can click on corresponding with the task and date square which will change the color of the squire (red - bad, green - good, yellow - neutral). With the help of some good folks here on the forum I’ve build that but the load time just for 4 tasks is about 30 seconds (you can see that in the editor/preview that I have provided below).

Preview:
https://tracke12.bubbleapps.io/version-test/habits?debug_mode=true

Editor:
https://bubble.io/page?type=page&name=habits&id=tracke12&tab=tabs-1

One suggestion that I got is to load the data onto the page and then fill up the RG from there - the problem is I can’t figure out how to define the data source.

Can you guys suggest if I can speed up the search for in conditionals or how do I load the data from the RG into another RG?

I might be oversimplifying things, but it why aren’t you saving the habit_track field to the Habits object?

Doing that would turn your conditional statements from:

This: “Search for habit_track: first item’s Done123 is x” (Doing this on each Habit in the repeating group is killing your performance).

Into this: “Current cell’s habit_track’s Done123 is x”

Once you change those statements out, I would also change your “only when” statements on the workflow to “only when current cell’s Habit’s habit_track…” rather than another “search for” statement, which is likely hurting your performance.

Hope all that helps!

Hey @nnich19 thank for your answer.

I’m sorry ,I don’t think I fully understand what you mean. Are you suggesting that I should get rid of the habit_track object completely and save the data directly into new field type as Date and Done123 in Habits objects? In that way how can I load the list of Habits onto the calendar that display it only one time because every new Date would create new row of data within Habits object.

So what search do I have to setup onto RG so that I can find the data with the corresponding date of the cell? Do a search for Habits: date=current cell’s data and name = current cell’s habit (I dont think the 2nd restraint is possible?) ?

I know, search for is killing me :frowning:

I will try to test out your suggestions tomorrow.

Hey guys,

so @nnich19 approach seems to be right direction but its not that simple. I changed the conditions and data source of the the RG, but as I suspected there is a problem with displaying data.

In RG data source is set to „search for habits” and because I changed the data to save into Habits_1 object every time there is a new set of data the list (RED ARROW) is getting longer.

What I need is to have one set of data (habit) in one row ( BLUE ARROW).

Editor: (its a second table)
https://bubble.io/page?type=page&name=habits_tests&id=tracke12&tab=tabs-1

If I change the source date of RG to RG List of habits (list where the names of habits are displayed) to create only one row for every habit - it only shows one date (the first row) correctly and not all of them.

Can you guys give me any tips what needs to be changed? I just can’t figure it out.

Ok, I figured this out.

For future reference:

Just as @nnich19 suggested it is possible to do this without search for conditionals. This solution is significantly faster but its not that fast - it depends - sometimes it is, sometimes its not. I don’t now why by having RG with with data loaded on the same page makes it (in my opinion) faster.

Okay, so what you need to do is to have an RG that will look for newly created habits (tag the habits with in some binary way because you need to have only one of them (if you will have a search for and many habits with the same name (and you will) the RG will show you obviously all the habits. (that one solved the column problem)

I tagged mine (for now) “main”. If I create new habit there will be only one “main=yes” with the name of the habit in my DB. The rest of inputs will have “no”/empty cell.

Within this RG is a group that will search for data that is specific for the habit we found in current cells of RG.

And then I have a group that will change the colors depending on the Parent group’s Habit.

image
If you want to create new thing when the current date cell’s is empty you need to create new group that will show up when needed because you can’t reference name/Data of the habit if the cell’s is empty. Well, that was my workaround for this.

I’m sure there is much more efficient way to do this, but this is what I was able to come up with for now. Hope it helps.

This is because each time you had a conditional with a “do search for” you were performing another new search…with one R.G. with data loaded, you do a search once and then reference that R.G. loaded with data as a datasource for your conditionals and do your filters on that.

Sometimes with large amounts of data I use two or three R.G. in a popup to set up some filters and sorts.

  1. R.G. with all data (R.G.1)
  2. R.G. with a filter (R.G.1:filtered) (R.G.2)
  3. R.G. with a sort (R.G.2:sorted)

On page I would be displaying R.G.3 which has the R.G.2 results sorted…may or may not be the correct method, but when testing it, it seemed fastest this way, especially when I perform complex filtering

You may also want to investigate how to work with “current cell’s index”…the index is just a number for which cell it is in the R.G. It has helped me with things, especially when needing to use the elements ID attribute because you can use a combo of static and dynamic data, the dynamic data being the current cells index number ( ie: group_habit_currentcellsindex ; would return things like group_habit_1; group_habit_2 ; group_habit_3 etc. )

3 Likes

Hey @boston85719!

I meant that having an RG on the page and not referencing it in the calendar makes it faster… but that might be just an illusion.

Yes! The filter option on the data source referencing the RG with the data is the key! It’s very fast now. (3-4 seconds compared to 10+ before, and even 40+ before that…) It will try to tweak it with your suggestions to improve it even more.

Will do that right now.

Thank you!

1 Like

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