Hi Team. When using an SQL data source, I not...

(Christian Farley) #1

Hi Team. When using an SQL data source, I noticed that we have the option to point directly to a table or to a view. My data source is a MySQL table with potentially millions of rows. Most of these rows are irrelevant for any given user, so to limit sync volume I am thinking I could set up user specific views on my single data source. e.g: - User Mary would connect to view “Mary” from the data source - User John would connect to view “John” from the same data source

Then at sync time, Appsheet would only pull rows that are relevant to that user. This would have very low impact on the MySQL servers and would void the need to maintain partitioned data tables.

I am not seeing a way to do this in appsheet. Is there one? Otherwise this could be a useful feature.

(Aleksi Alkio) #2

Documentation says… “Once a MySQL data source has been added to your account, you can add MySQL tables or views to any app. When you choose “Add Table” in your app, you can select the specific data source, and a table or view from that data source.”

(Dinh Nguyen Nguyen) #3

@Christian_Farley2 Hi Christian, to clarify @Aleksi_Alkio’s answer, MySQL tables and views both show up in AppSheet as tables. You can use any table or view in your MySQL database as a table in your AppSheet app. However, it is not possible to dynamically change the underlying MySQL view of an AppSheet table. For instance, it is not possible to change the underlying view of

a table based on who the user is.

If you want to filter data based on user’s identity, you can try using security filters instead. For SQL data sources, AppSheet will translate security filters into SQL queries that are sent to the database. Since the filters are included in the queries, the amount of data retrieved from the database will be reduced to improve performance.

(Christian Farley) #4

@Harry This sound exactly like what I need.

Can the filter only be set using the user’s email? or can we send another value, like a project ID for instance?

If I expand on my previous example: Mary = ProjectA John = ProjectA Bob = Project B

Id like both Mary and John retrieve the same data, as they share the same project.

(Dinh Nguyen Nguyen) #5

@Christian_Farley2 Hi Christian, you can use any value in the security filters, including project IDs to filter data coming from the database.

(Christian Farley) #6

Thanks!