
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
Invoke the AppSheet API
/ 25
Create a webhook to the AppSheet API
/ 25
Use Cloud Storage to store app objects
/ 25
The goal of this lab is to integrate your app with an external service to perform functions that are part of regular business operations. For example, your app's users may need to be informed of the status of the app's data, or an external application may need to fetch and update the app's data in a back office system.
In this lab, you learn how to perform the following tasks:
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:
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.
When working on your own or your company's app, you normally would incrementally build the app over a continuous project timeline.
Apps that you build are saved and accessible in the Recent section on the Apps page until they are deployed and published.
In this task, you create the app that was built in a previous lab, using a template.
In the lab environment on some occasions it's possible that the app built in a previous lab is still listed in the Recent section. You cannot use this app to continue working on this lab since the underlying data is not available for use by the app.
The app must first be deleted before you continue with this lab.
If the Inventory Manager
app is listed, on the 3-dots menu, click Delete.
To confirm the deletion, click Delete.
To continue building the Inventory Manager
app in this lab, you must first recreate the app from a template.
To copy the Inventory Manager app to your AppSheet account, click the link: Inventory Manager.
In the app preview, click Accept.
In the left navigation menu, click Copy app ().
In the Copy app form, for App name type Inventory Manager, and leave the remaining settings as their defaults.
Click Copy app.
AppSheet creates the app and copies the Google sheet that is used by the app to the /appsheet/data/InventoryManager-nnnnnnn
folder under the My Drive folder on Google Drive.
To go to the AppSheet editor, click Customize your app.
You can also access the app from the Apps page in the AppSheet UI under Owned by me.
Your app is set up with the original contacts data source, and you can now continue to build out the app's functionality.
Click Check my progress to verify the objective.
The AppSheet REST API enables an external application to access the data that is used by your AppSheet app.
By invoking the API, the external application can read, update, and delete data rows from tables used by your app and invoke predefined actions in your app.
In this task, you enable and configure the API and use a sample REST client to invoke the API.
In the AppSheet UI, in the left navigation bar, click Settings () > Integrations.
In the IN: from cloud services to your app section.
To enable the API, select Enable.
To create a key that client apps need to invoke the AppSheet API, click Create Application Access Key.
This displays the Show Access Key. Copy the value of key and App Id. Now, click Save to save the app.
For the purposes of testing, use the Hoppscotch browser-based REST client.
In a separate browser tab, open the REST client.
Perform the following steps in the Hoppscotch UI:
For the HTTP method, select Post, and type the following code, replacing [appId] with the value of App Id from the Settings > Integrations tab in the AppSheet editor, and replacing [tableName] with Products:
The API will be invoked on the Products table in your app.
Select the Headers tab.
For Header 1, type ApplicationAccessKey
For Value 1, copy and paste the access key value from the Settings > Integrations page in the AppSheet editor.
Your entry should look like this:
Select the Body tab.
For Content Type, select application/json.
For Raw Request Body, type:
The request body specifies Action: Find, which is used to fetch a row from the Products table. The row to fetch is identified by the Product ID key column value: Paper Towel Holder-123.
To send the request to the AppSheet REST API endpoint, click Send.
Your results should look like this:
In this task, to update data via the AppSheet API, you modify the API request in the Hoppscotch UI by adding the column to be updated with its new value in the Rows array.
In the request body, change the value of the Action attribute to "Edit".
To update the product's Price, specify the Price column with its new value:
To send the request to the AppSheet REST API endpoint, click Send.
The API response contains the product details with the updated Price value. Also, note that the Price Updated column is modified to reflect the time of the update operation.
Return to the AppSheet editor, and view the product details in the app preview. The updated product price should be displayed.
You can perform other operations like Add and Delete of table rows via the AppSheet API. For more information about using the API, see the Manage apps using the AppSheet API documentation.
Click Check my progress to verify the objective.
AppSheet supports webhooks that you can use to send data to external web services via the app. You can create webhooks to services like Google Chat, Zapier, and Slack. AppSheet also supports webhooks to the AppSheet REST API.
In this task, you create a webhook to send a message to Google Chat when an event is triggered in your app.
In a separate browser tab, open Google Chat.
If prompted, use your lab-provided Google Cloud username and password to sign in.
Click Get Started, and then close any help dialogs.
In the Spaces section, click Create or find a space (+), and then select Create a space.
In the Create a space dialog, for Space name, use:
Leave the remaining settings as their defaults, and click Create.
On the AppSheet Webhook menu, click Apps & integrations.
Click Add webhooks.
In the Incoming webhooks dialog, for Name, type AppSheet Low Inventory
Click Save.
To copy the webhook URL, click More () and click Copy link.
You use this URL to configure a webhook task in the next step.
To run the automation process when an event occurs in your app, you need a bot.
To create a bot, in the AppSheet UI, in the left navigation bar, click Automation (), and then click Create my first automation.
Click Create a new bot.
In the Bots pane, for New Bot, click More () and Rename to Low Inventory.
In the bot definition, click Configure event, and then click Create a new event.
In the Settings tab, click Link (), and then enable Linking.
In this task you will configure an event in your app that will cause the process to run when the event is triggered.
In the Settings tab, change the event name to Low Inventory.
For Table, select Products.
For Data change type, deselect Adds, Deletes, and then select Updates.
This event will be triggered when a row in the table is updated from the app.
For Condition, click into the field to launch the Expression Assistant.
In the Expression Assistant form, for Condition for event Low Inventory (Yes/No), type:
In the Expression Assistant, click Save.
To run the task, you need a process. In AppSheet, a process is a set of steps that are executed in sequence.
In the Low Inventory definition, to Run this process, click the down arrow next to Run this process, select Create new process, and then enable Linking.
To change the process name, click the Process for Low Inventory - 1, and rename to Low Inventory.
Click go to Process.
For Table, select Products.
To add a step in the process, click Add a step.
For Step name, select Create a new step.
A process can include different types of steps. The type of step used in this process is Run a task.
In this task you will create a webhook in AppSheet, and create a task that is executed when the webhook runs.
To create a task, in the Settings tab, enable Linking.
In the new task form, specify the following, and leave the remaining settings as their defaults:
Property |
Value (type or select) |
Task name |
Google Chat - Low Inventory |
Task category |
Call a webhook |
Table name |
Products |
Preset |
Custom |
Url |
the webhook URL that you copied from the previous subtask |
HTTP Verb |
Post |
HTTP Content Type |
JSON |
Body |
{"text": "<<[Product Name]>> is low on inventory, Current Inventory: <<[Current Inventory]>>."} |
Click Save.
To reload the app definition, click Sync () in the app preview. If the app preview is not visible, refresh the AppSheet UI in your browser.
In the app preview, from the app's main menu, select Low Inventory.
Click on any of the products to view its details, and then click Edit ().
Update the product's Price in the app.
Click Next, and then click Save.
Wait a few seconds for the app to sync the update to the backend.
Navigate to the browser tab where you created the Google Chat space and webhook configuration.
In the Spaces pane, select your AppSheetWebhook-
A chat message from the AppSheet bot should report the product with low inventory.
AppSheet also supports webhooks to the AppSheet API. You can use this type of webhook to trigger a change within your app.
To create the task, in the AppSheet UI, in the left navigation bar, click Automation () > Tasks, and then click Create a new task (+).
In the new task form, specify the following, and leave the remaining settings as their defaults:
Property |
Value (type or select) |
Task category |
Call a webhook |
Task name |
AppSheet API - Update Inventory |
Table name |
Shipping |
Preset |
AppSheet API |
App Id |
[App Id] |
Target Table Name |
Products |
For Body, type:
Click Save.
As mentioned earlier, to run the task, you need a process.
In the AppSheet UI, in the left navigation bar, click Automation ()> Processes, and then click Create a new Process (+).
For New Process, click More () and Rename to Delete Shipment.
For Table, select Shipping.
To add a step in the process, click Add a step.
For Step name, select Create a new step.
The type of step used in this process is Run a task.
To use an existing task, from the drop-down list, select the task that was created earlier: AppSheet API - Update Inventory.
Click Save.
As mentioned earlier, you configure an event in your app that will cause the process to run when the event is trigerred.
In the AppSheet UI, in the left navigation bar, click Automation () > Events, and click Create a new Event (+).
For New Event, click More () and Rename to Delete Shipment.
For Data change type, deselect Adds, Updates, and then select Deletes.
This event will be triggered when a row in the table is deleted via the app.
For Table, select Shipping.
Leave the remaining settings as their defaults, and click Save.
To run the automation process when an event occurs in your app, you need a bot.
In the AppSheet UI, in the left navigation bar, click Automation () > Bots, and click (+).
Click Create a new bot.
For New Bot, click More () and Rename to Delete Shipment.
In the bot definition, for when this event occurs, click Configure event, and then select the Delete Shipment event.
For Run this process, click the down arrow, and then select the Delete Shipment process.
Click Save.
Ignore any warnings that may be reported.
To reload the app definition, click Sync () in the app preview. Click on Mobile or Tablet icon to see the app preview.
Click Ship/Recv, and then click the Shipping tab.
Click the shipping transaction for product Paper Towel Holder. Note the value in the Quantity shipped column.
To view the details of the product in this shipping transaction, click the arrow next to the product.
Scroll the product details and note the value in the Current Inventory column for this product.
To return to the shipping transaction details, in the top bar of the app preview, click the back arrow ().
To delete this shipping transaction, click the Trash can (), and then click Delete.
Wait a few seconds for the app to sync the update to the backend.
Click Check my progress to verify the objective.
You can use Cloud Storage on Google Cloud to store your app's images and data files as objects. AppSheet also supports integration with other cloud object store providers.
In this task, you configure your app to use Cloud Storage to store your app's objects on Google Cloud. This lab pre-provisions a Cloud Storage bucket for use by your app. A bucket is a basic container that holds your app's data objects. For more information about how buckets are used in Cloud Storage, see What is Cloud Storage? documentation.
Before configuring your app to use Cloud Storage on Google Cloud, you must first:
Create a Cloud Storage bucket on Google Cloud.
Create a Google Cloud service account.
A service account is a special type of Google account intended to represent a non-human user that needs to authenticate and be authorized to access data in Cloud Storage and use other Google Cloud APIs. For more information about Google Cloud service accounts, see the Service Accounts documentation.
To access your bucket in Cloud Storage, AppSheet requires a service account. This lab pre-provisions a service account with the required permissions for use by your app.
In the AppSheet UI, in the top right menu, click the blue circle, and then select Account settings from the menu.
On the My account page, click the Integrations tab, and then in the left navigation menu, click Stores.
To add a new object store for your app, in the Object Stores section, click + New Cloud Store.
In the Add a new object store dialog, click Google Cloud Storage.
In the Add Google Cloud Storage integration dialog, for Name, type Google Cloud Storage
For Private Key JSON String, copy and paste the value of Cloud Storage Service Account in the Qwiklabs credentials panel of your lab window.
For GCS Bucket, type [PROJECT_ID]-appsheet-objects, replacing [PROJECT_ID] with the value of the Google Cloud Project from your Qwiklabs credentials panel in your lab window.
This is the name of the Cloud Storage bucket that was pre-provisioned for this lab.
To test the connection from AppSheet to the Cloud Storage service, click Test Connection.
The button should display a check mark indicating that the connection was successful.
Click Save.
Now that you have configured a connection to the cloud object storage service, you can configure any table in your app to use the object store to store data objects like images and files.
In the AppSheet UI, in the left navigation bar, click Data (), and then click Product Categories ().
An expanded view of the Product Categories table is displayed.
Click Table settings ().
Expand the Storage section.
For Store for image and file capture, select the Google Cloud Storage location that was configured in the previous task.
Click Done.
Click Save.
In the bottom navigation bar of the app preview, select Categories.
To add a new product category, click Add ().
In the new category form, specify the following, and leave the remaining settings as their defaults:
Property |
Value (type or select) |
Category |
Vacation |
Aisle |
6 |
Shelf |
3B |
Download a new product category image, and save the image to your computer.
For Category Image, click the camera control and upload the image from the previous step.
In the app preview, click Save.
In a separate browser tab, to open the Google Cloud Console, click Open Google Cloud Console in the Qwiklabs credentials panel of your lab window.
Sign in using the Google Cloud Username and Google Cloud Password credentials from the Qwiklabs panel in your lab window, and accept the user agreement.
In the Google Cloud Console, on the Navigation menu (), scroll the list of products and then click Cloud Storage > Buckets.
Click the storage bucket name.
AppSheet stores your objects in folders in the bucket.
To view the contents of the folder, click the folder name, and then click the Product_Categories_images folder.
The folder should contain the image of the product category that you uploaded via the app.
Click the object name to view details about the image object.
You have successfully configured your app to integrate with external services and the AppSheet API.
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