Repeating Group Data Source "Search for User" is Going Super Slow

Hello, for the messaging section of my app I am using a repeating group to display users that the admin is having conversations with.

I want the admin to be able to search for individual users so I have added an input bar that the admin can type in user’s names which then causes the repeating group to filters the users displayed.

The functionality is working well, however, it takes 10-20 seconds to filter the repeating group after typing into the input bar. I have around 2000 users in the database which I don’t think should be too many for Bubble to handle.

Any ideas on how to speed this up?

Thanks so much.

Technically, the search is happening after every change in the Input Search Customer’s value → That means after every character addition. You can make it faster by not filtering based on the Input value real time but with a button click and using the display list in a repeating group action.

image

1 Like

Not quite true. The value is
updated when focus is removed from the input (which is probably a good decision by Bubble). Display list would also be no faster than the data source.

There’s no obvious reason why it’s slow. What fields do you have on the User type? Are they quite heavy? Are you sure it’s not your internet?

1 Like

Actually, with the way he set it up, it is on every change no matter what the focus is:
rg-search

Because he did the filtering in the RG data source, not as a workflow action:

Oh :thinking:

Well then answer is somewhere in the middle.

If you display a text like Input A’s value, the text is updated when the focus is removed or after a short time. It is not updated every character.

For reference, when I load a simple RG with an input search box and type ‘Lorem ipsum’, there are 3 searches done.

  • Once on page load
  • Once when L is typed
  • Once when the full text is completed (Lorem ipsum)

I’ve never noticed that an RG search might be updated sooner than the value that’s accessible to other elements, but it definitely doesn’t update after every character addition.

Don’t use the input. Instead use a search box element which will provide suggestions matching the typed value. User will select the user in suggestions of search box element.

In your RG if you want to display the selected user, use condition when search box values is not empty to change the datasource of RG to be search box value :converted to list, but if you don’t need RG to show selected user and just want to allow selection of user to then show conversation, you just use search box selected user.

1 Like

I beg to disagree.

When you slowly type things, it does search for after every character:
rg-search-slowtype

When you type faster, it still does a search but less:
rg-search-fasttype

This might be a better solution. I will test when I have time.

Exactly, so not every character, otherwise we’d be eating up WU like they’re nothing :slight_smile:

Could you provide a quick step by step on how to use the browser developer tools to demonstrate what is happening in the app with the searches as you did in the videos? This is an area I need to become more familiar with and don’t have much sense of how to utilize browser developer tools to analyze the performance of the app.

I know it’s not a video but might still be helpful:

msearch is Bubble running Do a search for. If you make a test page with two uses of the identical expression, you’ll see in general it only makes the request once. Click the request to see the data it returns (payload).

mget is getting a specific Thing (e.g Current User’s Company). It puzzles me that we can’t use this in expressions and have to do a search for unique ID.

maggregate (or some variation of that) is an aggregate that returns a value e.g Do a search for User:count

You can view these in the developer tools network tab. I noticed the other poster’s requests are named differently (search vs msearch) - might be a browser thing or a Bubble change, but I’ve always seen msearch.

2 Likes

Actually, I can’t help you any more than basics.

When you open Dev Console through Menu > More Tools > Developer Tools, the network tab is showing all the things a web app is doing in terms of network wise. The list shows a bunch of calls happening to any other service from the browser (current tab).

So the red marked things are either resources from some third party or the backend (which is technically a third party again from the browser point of view).

The names you see in this network may not be (actually probably are not) the same as your see in the bubble app designer. Some of them are recognizable as George mentioned. For example, you can easily say this is an API call: do API call from server :slight_smile: Some others you will see that these are called when you do something and you will recognize what they are (like the one I put above to analyze repeating group filtering).
image

Then, you can click on any call and see what was the request and response.
For example, this is one of searches’ response headers:

With this payload:

And the response was this: It just returned one result.

There are many more features of this of course and many videos on youtube. I use network tab a lot and I also use the mobil-view etc a lot to check responsiveness of the pages.

I hope this at least gives an intro.

3 Likes

I gave this a shot too. But it does a similar search at every letter again. I am sure there are differences but it looks like a call per letter:
rg-searchbox-fasttype2

Also, default searchbox just search by starting from the beginning (no partial searches) and you can’t select more than one I guess (correct me if I am wrong for the default searchbox). You have to do other tricks to capture other elements searched (like multi-dropdown maybe).

If we come back to the original question, I think if it is taking too much time @trevorhenderson1 , try doing the filter by using a button in my first post [Repeating Group Data Source "Search for User" is Going Super Slow - #2 by hergin] (which is sure to call just one do a search for). And report back to us maybe.

1 Like

That’s a great idea, thank you for your advice!

This is the solution I implemented and it is working lightning quick! Thank you for your advice!

1 Like

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