
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Create the app
/ 25
Create a security filter
/ 25
Use data partitions
/ 25
The goal of this lab is to introduce techniques to improve your app's scalability and performance.
When working with large datasets, it is beneficial to partition the data based on how users access that data via the app. For example, users of a project management app might only use project and task data that is relevant to their own projects. Other app users who work on different project teams might only use data that is specific to those projects.
You can design your app with security filters and data partitions based on the app user's affiliation with that data and thereby improve the performance of your app.
In this lab, you learn how to perform the following tasks:
Create an app without partitioned data as the default.
Create security filters to limit the data used by the app.
Partition the data in separate worksheets, and configure the app to use the different partitions.
Enable the app to support user settings.
Apply the user's choice of settings to control access to the partitioned data in the app.
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long lab resources will be made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It gives you new, temporary credentials to sign in and access AppSheet for the duration of the lab.
To complete this lab, you need:
Access to a standard internet browser (Chrome browser recommended).
Time to complete the lab.
Make sure you sign in to the lab using an incognito window.
When ready, click .
A new panel will appear with the temporary credentials that you must use for this lab.
If you need to pay for the lab, a pop-up will open for you to select your payment method.
Note your lab credentials. You will use them to sign in to AppSheet for this lab.
Click Open AppSheet to open the AppSheet UI in a separate browser tab or incognito window.
Click to sign in with Google.
In the Sign in with Google dialog, enter the provided Username, and click Next.
Enter the provided Password and click Next.
Click Accept to accept the terms.
To enable AppSheet to access the Google Drive folders associated with your lab account, on the AppSheet consent page, click Allow.
You're now signed in to AppSheet.
To view the AppSheet MyApps page, click X in the top-right corner of the Tell us about you so we can make better recommendations dialog.
The MyApps page might be empty since you do not have any apps yet.
In this task, you use the AppSheet UI to create a new app that connects to a data source.
On the Apps page in the AppSheet UI, click + Create > App > Start with existing data.
For App name, type Project Manager
For Category, select Planning & Project Management.
Click Choose your data.
In the Select data source dialog, select Google Sheets.
In the file picker, select the Projects spreadsheet from your My Drive folder on Google Drive, and click Select. This sheet was automatically provisioned for the lab.
AppSheet creates the app and displays it in the AppSheet editor UI.
Click Customize your app.
You are now in the AppSheet editor UI. The UI also provides a live preview of the app running in an emulator, which you can use to test the app's functions.
Click Check my progress to verify the objective.
The Project Manager app uses a Google sheet that contains project information.
In this task, you update your app's data structure and add the task data to your app. You also create a view to display the projects' tasks in the app.
In the AppSheet UI, in the left navigation bar, click Data ().
To expand the table configuration, click Projects ().
For the Project ID column, change its Type to Text.
Select the Key property for this column.
For the Name column, clear the Key property.
Click Save.
In the AppSheet UI, in the left navigation bar, click Data ().
To add the project task data to your app, click Add new Data (+), and then click Add Table "Tasks" from suggestions.
Click Add This Table.
For the Tasks table, clear the Key property for _RowNumber column.
The Task ID column contains unique values for the individual tasks in the sheet. To set this column as the key column for the Tasks table, select the Key property.
The Project ID column in the Tasks table contains values that refer to the Project ID column in the Projects table.
Change the Type of the Project ID column in the Tasks table to Ref.
In the Tasks : Project ID column definition dialog, for Source table, select Projects.
Click Done.
Click Save.
In the AppSheet editor, in the left navigation bar, click App () > Views (
).
Click Add View (+), and then click Create a new view.
In the new view form, specify the following, and leave the remaining settings as their defaults:
Property |
Value |
View name |
Tasks |
For this data |
Tasks |
View type |
table |
Position |
later |
Click Save.
Your app is now configured with the Projects and Tasks data.
To view the list of projects, in the bottom navigation bar of the app preview, click Projects.
To view the list of tasks of all the projects, in the bottom navigation bar of the app preview, click Tasks.
With the current app design, the entire list of projects and tasks is fetched by the app from the AppSheet backend and the cloud provider.
All app users access all the project and task information in the app. In reality, a given app user might only need to access a specific project and its tasks while they work on that project.
In this task, you implement security filters to improve app performance by limiting access to data that is relevbant only to the signed-in user.
The first task in this process is to define project team membership.
In a separate browser tab, open Google Drive, and if prompted, sign in to Drive.
Open the Teams sheet that has been provisioned by the lab. This sheet has two worksheets: Members and ProjectTeams.
The Members worksheet contains data about each team member, and the ProjectTeams worksheet contains data about the project membership of each member.
In the AppSheet UI, in the left navigation bar, click Data ().
To add the new data to your app, click Add new Data (+).
In the Add data dialog, select Google Sheets.
Select the Teams sheet, and then click Select.
In the Create a new table dialog, for Worksheet Name/Qualifier, select Members.
Leave the remaining settings as their defaults, and click Add This Table.
Repeat the previous steps to add the ProjectTeams worksheet to your app.
In the ProjectTeams table definition, for the Member ID column, change the Type to Ref.
For the Member ID column, change the Type to Ref.
In the ProjectTeams : Member ID column definition form, for Source table, select Members, and then click Done.
For the Project ID column, change the Type to Ref.
In the ProjectTeams : Project ID column definition form, for Source table, select Projects, and then click Done.
In the ProjectTeams table column defition, for _RowNumber, clear Key, and then select the Key property for both the Project ID and Member ID columns.
Click Save.
AppSheet automatically generates a _ComputedKey column to serve as the key column for this table.
Security filters are typically used to control access to data in the app, and they also serve the purpose of improving an app's performance by reducing the amount of data transferred between the cloud provider, the AppSheet backend, and the app running on the user's mobile device.
To create a security filter for the Projects table, in the AppSheet UI, in the navigation bar click Security > Security Filters tab, and expand the Projects table definition.
To open the Expression Assistant, click into the Security filter expression field.
In the Expression Assistant form, for Security filter for table Projects (Yes/No), type:
In the Expression Assistant, click Save.
Click Save.
In the AppSheet UI, in the left navigation bar, click Data (), and select the Members table, and then click View data source.
AppSheet opens the Members worksheet in a separate browser tab or window.
Edit the email column of the row with Member ID: 1002, and change the email address to your lab user email address.
To refresh the app's data, in the app preview, click Sync ().
Only projects in which you are a member (based on your email address), are now displayed in the app.
With the use of security filters, the amount of data transferred between the app and the AppSheet backend and the amount of data stored on the user's device is reduced.
Click Check my progress to verify the objective.
You can partition the data used by your app to further improve its scalability and performance. To partition the data, you divide it into separate sections with the same column structure.
Each partition contains a different subset of the rows of data, and app users access data from a single partition at any given time when using the app.
In this task, for the projects' tasks data, you use separate tables that are sourced from separate worksheets. Each worksheet contains task data for a single project.
In the AppSheet UI, in the left navigation bar, click Data (), and select Tasks to expand the Tasks table definition.
Click More (), and then click Delete.
Once asked Are you sure, click Delete to remove the table from the app.
In a separate browser tab, open the Partitioned Tasks sheet on Google Drive.
View the content of each worksheet. Each of the worksheets has an identical column structure and each contains the tasks that make up an individual project.
In the AppSheet UI, in the left navigation bar, click Data ().
To add the new data to your app, click Add new Data (+).
In the Add data dialog, select Google Sheets.
Select the Partitioned Tasks sheet, and then click Select.
In the Create a new table dialog, for Worksheet Name/Qualifier, select Project 1 Tasks.
Leave the remaining settings as their defaults, and click Add This Table.
To edit the Project 1 Tasks table column definition, change the Type of the Project ID column to Ref.
In the Project 1 Tasks : Project ID column definition dialog, for Source table, select Projects, and then click Done.
Click Save.
In the Project 1 Tasks table definition, click Table settings (), and then expand the Scale section.
Enable Partitioned across many worksheets.
To open the Expression Assistant for Partition Expression, click into the field.
In the Expression Assistant form, for the Partition selection formula, type:
Click Save.
In the Partitions section, for Partition, type P1
For WorkSheet to use, select Project 1 Tasks.
To add another partition, click Add.
For Partition, type P2
For WorkSheet to use, select Project 2 Tasks, and then click Add again.
For Partition, type P3
For WorkSheet to use, select Project 3 Tasks.
Click Done.
To save your changes to the app, click Save.
In the AppSheet UI, navigate to App () > Views (
), and then click the Tasks view.
In the view definition, for For this data, select Project 1 Tasks.
Click Save.
In the bottom navigation bar of the app preview, click Tasks.
The tasks that are displayed are based on your user email's project membership in the ProjectTeams table.
Based on the current project assignment, tasks from either Project 2 or Project 3 are displayed in the app.
In the Members worksheet on Google Drive (in Teams sheet), copy the value in the email column of the row with Member ID: 1002, and paste it in the email column of the row with Member ID: 1001.
Edit the email column of the row with Member ID: 1002, and change the email address to: e2@company.com.
To refresh the app's data, in the app preview, click Sync ().
You should now see that the tasks displayed in the app are from Project 1 because the signed-in user is now a member of this project.
Click Check my progress to verify the objective.
The User Settings feature in AppSheet allows the app user to customize the app's behavior by changing the settings of certain options in the app.
In this task, you define user settings to enable the app user to select a project from a list of projects that they are a member of. You then leverage the previously configured data partitions to provide app user access only to the selected project's tasks in the app.
In the AppSheet UI, in the left navigation bar, click Data ().
Under Options, click User Settings.
To edit the Options Heading option definition, click Edit ().
To display this option as a user setting in the app, in the option definition form, select Show.
To open the Expression Assistant for Content, click into the field.
In the Expression Assistant form, for Content (LongText), type "Select your project:", click Save, and then click Done in the form.
To edit the Option 1 option definition, click Edit ().
In the option definition form specify the following, and leave the remaining settings as their defaults:
Property |
Value |
Column name |
Projects |
Show? |
Select |
Type |
Enum |
Type Details > Base type |
Ref |
Base type details > Referenced table name |
Projects |
Input mode |
Buttons |
Expand the Data Validity section, and click into the Valid If field.
In the Expression Assistant form, for Valid If formula for column Projects (Yes/No,List), type:
and then click Save.
Expand the Auto Compute section, and then repeat the step above to set the expression for Initial Value:
In the option definition form, click Done.
Click Save.
Because you are now using the user settings values, the partition expression must be re-configured to select the app's data partitions.
In the Project 1 Tasks table definition, click Table settings (), and then expand the Scale section.
To open the Expression Assistant for Partition Expression, click into the field.
In the Expression Assistant form, for the Partition selection formula, type:
and then click Save.
In the table settings form, click Done.
Click Save.
In the main menu of the app preview, click Settings.
Select a project from the list and click Save.
In the bottom navigation bar of the app preview, click Tasks, and verify that the tasks displayed belong to the selected project.
In the Members worksheet on Google Drive (in Teams sheet), copy the value in the email column of the row with Member ID: 1001, and paste it in the email column of the row with Member ID: 1002.
Edit the email column of the row with Member ID: 1001, and change the email address to: e1@company.com.
To refresh the app's data, click Sync ().
Repeat the previous steps to select a different project from the user settings page, and verify that the list of tasks displayed are from the newly selected project.
You successfully completed the lab to implement techniques to improve the scalability and performance of your app.
In this lab, you learned how to:
When you have completed your lab, click End Lab. Qwiklabs removes the resources you’ve used and cleans the account for you.
You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.
The number of stars indicates the following:
You can close the dialog box if you don't want to provide feedback.
For feedback, suggestions, or corrections, please use the Support tab.
Copyright 2022 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one