Data View Question - Use conditions to only return single record from table instead of whole table?

Using a data view will be useful for the project I’m moving from Bubble to Wappler.

I’ve read that if you use Data View in App Connect it loads the entire table, which naturally isn’t optimal from a performance basis as a dB might grow.

I’m not sure if this is the right way to do it, but I’ve create the data view on the app side, selected the data source and then used the magic wand to to add a condition ‘where’ and the property equals the ‘id’ of the record, and the value is the records id that I pass via the url.

Would this effectively then have page view only load a single record on the page?

Please have a look at

This will give you an idea of how to use the Data View. This is useful for less than about 3K records.

To ensure that you do not load more records than that, you could filter the database by using something like:

1 Like

Use a data-detail component for single objects. I often load a set of data (not the entire table) into a data-view…this represents a collection of things (like cars). Then when I want to deal with a single car, I just set the record of the data-detail by the id that tracks it. In other words, the data-detail gets its data from the data-view.

And Ben is absolutely right that there is a performance issue after a few thousand records…but there is a workaround for that but very manual and very javascripty…but its there when you are ready.

In Bubble terms, the data-view is a list of things, while data-detail is a single thing.

Got it, thank you - and thank you for breaking it down to Bubble lingo!

So, for this use case I need data-detail. I’ve been trying with this, under the app connect:
Screen Shot 2020-07-10 at 5.56.23 pm

What I’m struggling with, is the exact parameters to ensure that I only pull in all the data for a single record based on the button click from the previous page (that has a child repeating group of records). I’ve effectively been able to pass parameters via the url (using :id) but I can’t seem to capture that down to page level, it seems like you are doing exactly what I need if you wouldn’t mind once again pointing me in the right direction

I have this in the data detail properties:
Screen Shot 2020-07-10 at 6.03.13 pm

The data source will point to a collection of data. The key is the field within that data source that will be the id.

And the value, which can be set in a variety of ways, is the id of the record you want to reference.

So if your value is coming in via a route, you can set your data detail value to that route parameter, which is available in the picker.

1 Like

Thanks Ken, so I have source and key correctly setup.

For the value, it needs to be fixed, so it can’t be a session or cookie as i’ll use this method for a public page for anonymous visitors too.

What would you say is the most ‘static’ way to get the specific record ID? I have looked for the route data picker, but can’t find it anywhere in data bindings.

Not sure if/how node impacts this for you, but this is how I’ve done routes with parameters:

With a content page route like this:

You can select its parameters in the data bindings like this:

Note here that I’m showing the id being converted to a number as it is necessary for the data-view to work.

Note: I don’t view this as static, but I think it is what you are describing.

Thank you Ken for taking the time to do that, unfortunately I don’t have the route option in my data bindings. I assume due to it being a NodeJS project. I can manually enter the number in in a server action filter I’ve created and it displays the right data - but for whatever reason I cannot get it to interact with a URL parameter.

You may want to check the image gallery tutorial by @ben
Image gallery tutorial especially video number 4 and 14.

1 Like

Thank you, checking this out today!