Client filters, when is the data filtered?

We have started to implement lazy loading throughout our app by setting different client filters based on where the user is in our app. However, we are still experiencing some customers who are getting errors when loading data sources that should be empty, because of what looks like they are getting too much data being loaded into the client.

That made us think about, does the client filter actually filter out what data comes to the client from the database, or is all data still being read to the client, but just filtered out in the UI and in dev tools?

We didn’t find the description of client filters in Create or the documentation that helpful.

Hi @Jonas! Client filters cannot be used for lazy loading, as all data is read from the database to the client, and only then the filter is applied client-side. We’ll have a look at the docs to make this more clear.

Okay, that was clarifying. Thank you!

Would you say the best solution for implementing lazy loading as of now is to use a runtime data source and read the data on demand?

The cleanest strategy would probably be to use the disabled tag on your data source, which you toggle to enabled when needed.

We would definitely need something more granular than that, as we only want to load a set of data in different cases. So we’ll test now to set this up with a runtime datasource and just read objects as we need them.

1 Like

In this case, it might be the way to go. Let us know how it goes :slight_smile:

1 Like