Do you need to store data from your Web App, or perhaps a quick hack? Do you need to show user inputs to non CS people? Do you want need a quick solution without going into the hassle of setting up a Database? If your answer to any of those questions was a yes, then you’ve come to the right place. This post will show you how you can use Google sheets as your database.
For the purposes of this blogpost I will be usiing this Google sheet.
As you can see, we will be collecting the following data from the user – Name, Email and Age.
Create the API
- Go to the google sheet you want to use.
- Create column headers in the first column
- Click on tools> script editor
- Copy the following code to the editor
- Click on run>run function> setup.
- Now publish your script to get the request URL with the following settings.
- Here is a video of me doing the above
Now let us test this URL in a webpage.
You can enter your details here to see your details being updated in the Google Sheet above( refresh to see changes) .