Return a subset of table fields from a server call

What I’m trying to do:
I call server functions to return table iterators to populate data grid/repeating panels. I’d like to return a subset of the table row columns to speed things up

What I’ve tried and what’s not working:
I return app_table..search()

I’d like to return just a subset of fields for display rather than the full table row, I think this is really slowing things down

When you’re talking about speeding things up, there are many, many possibilities. If your table has a lot of columns, from what I’ve heard from other people, that might very well slow things down. But so could the imports of your server module, and other factors.

So it’s worth taking an overall view of the speed of server calls, and working out where your delays are. There are posts on the forum that talk about timing your imports and other factors.

To get back to your original question, your search iterator can be limited by rows, but not by columns. If you want to return a subset of columns, you have to build a list of dictionaries containing only those columns you want to send back to the client. You lose the lazy benefits of the search iterators, but later pages will load instantly. It really depends on how much data you’re processing as to whether that makes sense to do.

There is a feature request for allowing selection on a subset of columns that you can like to show support for: Client-readable views on a subset of columns

How many columns are in your tables?

maybe 12 columns, but some of those are media objects and I think that’s slowing things down, I really don’t need those returned to the front end. I’ll trying building a list of dictionaries and see if that improves things, thanks

From memory I think linked rows and media objects aren’t currently cached so it has do a separate server call when they are requested any way. I’m sure Anvil staff can confirm