Hi All. I’ve built a CRM app that’s become very slow, because of syncing large tables. I’m looking for the best practice to stop the default sync and instead load related data only when a user requests it.
My App’s Structure:
My app tracks client communications and has three key tables in a Supabase (PostgreSQL) database:
-
Clients: A small table with a few thousand rows.
-
Emails: A large table with 62,000+ rows and growing.
-
email_client_links: A join table with 150,000+ rows. This is necessary because a single email can be associated with multiple clients (one person may have mulitple businesses ie clients)
The Bottleneck:
Currently, in my Clients_Detail view, I rely on the automatic Ref_Rows virtual column ([Related email_client_links]) to list a client’s emails. This forces AppSheet to sync both the Emails and email_client_links tables entirely to the client device, which is causing major performance degradation on app load and navigation.
My Goal: On-Demand Data Loading
I want to completely change this pattern. The goal is:
-
The app should load quickly, without syncing the Emails or email_client_links tables.
-
The Clients_Detail view should load instantly.
-
I want to remove the automatic Ref_Rows list and replace it with a “View Emails” action button.
-
When a user clicks this button, the app should perform a live query to fetch and display only the emails associated with that specific client.
My Specific Questions:
-
How do I correctly use a Security Filter to prevent the Emails and email_client_links tables from syncing any data on the initial app load? I’ve seen suggestions to use a Security filter (edited) with a TRUE = FALSE condition, but I want to be sure this is the right approach for both tables.
-
What is the correct formula for the “View Emails” Action? I assume the action should be Go to another view within this app using LINKTOFILTEREDVIEW. I need the correct filter expression that tells the target view to display only the emails where the email’s ID is present in the email_client_links table for the current client. Will this then query my postgres/supabase for pertinent rows?
Any guidance, links, best practices, or formula examples for this “on-demand” pattern would be hugely appreciated.
Thank you



