AppSheet API Data Source Quickstart [Beginner]

Here's a quickstart project for creating a simple API and using it as a data source in AppSheet.  The docs for creating APIs that are compatible with AppSheet are here. Here are the instructions for deploying a simple API to Google Cloud, and linking it to a new AppSheet app.  

Prerequisites:

- An AppSheet account with the capability to configure an Apigee (API) data source

- A Google Cloud project (free account works fine, only Cloud Run & Firestore are used, which have free tiers)

End result

At the end of this guide you should have a notepad app up and running use a Note API (deployed in GCP Cloud Run) and using Firestore (serverless database) as storage. 

Screenshot 2022-03-03 12.13.43.png

 

Step 1: Deploy notes API

You can deploy a sample notes API & database with one click from GitHub here: https://github.com/tyayers/appsheet-api-template.  Simply click on the Run on Google Cloud button to do the deployment.

 

image_1646302594112.png

The deployment should be completely automated based on your logged-in Google user (with access to a GCP project).  You have to select your GCP project, region, and then the deployment should complete within 2-3 minutes.

 

image_1646303119579.png

In case any errors occur, just post here in the chat (certain organizational polcies can prevent a successful deployment).  Now copy both the API_KEY and the finished deployment URL to use later.  In the screenshot above the API_KEY is cPvBrNtZip3d9eINZmNpmAzVHRyde7QXcLOtn77cQHwsi7nv5tjGgXZIYCKiW9XZQ9jihtNo+/e5avBmctL12A==

and the deployment URL is https://appsheet-api-template-7d434midgq-ew.a.run.app

 

This service contains both the API service as well as OpenAPI spec that AppSheet will use to connect to as an API data source.

 

Step 2: Configure AppSheet Apigee (API) Data Source

Now go to your AppSheet Account page, and click on New Data Source.

image_1646302383308.png

 

Then type the name Notes API and click the Apigee data source. 

 

image_1646303965747.png

 

 

 

 

 

 

 

 

Add the API_KEY and Deployment URL that we copied above into the Apigee API Key and OpenAPI Spec URL fields, and click Validate, and then Authorize Access.

 

Screenshot 2022-03-03 11.42.59.pngEverything should work out-of-the-box here, the OpenAPI Spec and first service query are parsed and checked automatically in the background.

 

 

 

 

 

 

Step 3: Make an app

Now that our API connection is complete, we can build a first app using the API data.  Go to My Apps in AppSheet and click on Make a new app and then on Start with your own data.

image_1646304450812.png

image_1646304556604.png

 

 

 

 

 

 

Then click give your app a name (like Notebook) and click on Choose your data.

image_1646304651473.png

Now click on our Notes API to select the service as data source.

image_1646304732123.png

And then click on the notes object (APIs can deliver multiple resources, but ours just does notes, for now).

image_1646304804380.png

Now wait for the app to be setup.

After the app is generated and you see the Welcome Screen, click on Customize app.

Now click on the notes table and then on View Columns to open up the column configuration.

image_1646305375310.pngimage_1646305516740.png

 

 

 

 

 

 

 

 

 

Now make the name column the LABEL and change the location TYPE to Address.

image_1646305626321.png

And now go to UX and click on the notes View to change the view configuration.

image_1646305768876.png

Change the View type to map and the Map column to location.

Now the first version of our app is complete.  Try adding some new notes and further improving the look & feel with icons, formatting rules, etc..

Screenshot 2022-03-03 12.13.43.png

After making some changes to the notes, now open the Google Cloud console and see both the service and data running in your GCP project. Check out the service running in Cloud Run and see the metrics of the requests made from your app.

Screenshot 2022-03-18 13.19.02.png

 

And check out our database in Firestore, where you can see all of the data and any changes that users have made through the app.

Screenshot 2022-03-03 12.17.23.png

In case you have questions, or would like to build upon or extend this demo in any way, just reach out here in the forum.  All comments and suggestions are very welcome.

 

 

4 1 3,777
1 REPLY 1

Hi!,

Thank you for this article, it was really helpfull to make our PoC.

I would like to ask why this ENV variable "API_KEY" is working? 

I didn't found any information on this matter in Cloud Run docs, so I I suspect that its related with openapi and webpy.

I noticed that its only checks if this apikey header is present in request, but the value could be anythink. I understand tha checking this header should be implemented in app.py?

Top Labels in this Space