ou have an eCommerce site and you require a spreadsheet to be updated as and when an order is placed

Zyounes Dellihr D
4 min readDec 9, 2020

Google Sheets can be a really powerful tool when combined with Apps Script. Apps Scripts is like macros in MS Excel but with a lot more extensibility.

Picture this — You have an eCommerce site and you require a spreadsheet to be updated as and when an order is placed. You can pull the data using APIs at fixed intervals but a neater way to do this is to use Google Sheets as a webserver or a webhook.

In this article, I will show you how you can convert your Google Sheet into a web application to capture data and populate the sheet. This is a free alternative to using tools like Zapier but will require some coding experience.

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9fmht/official_livestream_cowboys_vs_ravens_live/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9fmi4/officiallivestream_ravens_vs_cowboys_live/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9fmif/nfl_cowboys_vs_ravens_live_streamreddit_free_hd/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9fmj5/officialstreams_cowboys_vs_ravens_live_stream_by/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9fmk1/officialtv_cowboys_vs_ravens_live_streamsreddit/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9fmkg/livestreamofficialcowboys_vs_ravens_live_streams/

https://www.reddit.com/r/RavensvsCowboyslives/comments/k9fmnb/officialreddit2020cowboys_vs_ravens_live/

https://www.reddit.com/r/RavensvsCowboyslives/comments/k9fmob/streamofficial_cowboys_vs_ravens_live_streamreddit/

https://www.reddit.com/r/RavensvsCowboyslives/comments/k9fmot/officiallivestream_2020ravens_vs_cowboys_live/

https://www.reddit.com/r/RavensvsCowboyslives/comments/k9fmp6/officiallivestream_cowboys_vs_ravens_live/

https://www.reddit.com/r/RavensvsCowboyslives/comments/k9fmpg/streamofficial_ravens_vs_cowboys_live_streamreddit/

https://www.reddit.com/r/RavensvsCowboyslives/comments/k9fmpu/officiallivestream_baltimore_ravens_vs_dallas/

https://www.reddit.com/r/Nflweeks13livest/comments/k9fmq1/nfl_baltimore_ravens_vs_dallas_cowboys_live/

https://www.reddit.com/r/Nflweeks13livest/comments/k9fmq9/officialredditravens_vs_cowboysreddit/

https://www.reddit.com/r/Nflweeks13livest/comments/k9fmhf/nflstreamsreddit_cowboys_vs_ravens_live/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9fmqi/officialredditravens_vs_cowboyslive_streamsreddit/

https://www.reddit.com/r/RavensvsCowboyslives/comments/k9fmqr/officiallivestream_ravens_vs_cowboys_live/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9fmu7/matchthreadravens_vs_cowboys_live_streams_reddit/

https://www.reddit.com/r/RavensvsCowboyslives/comments/k9fmul/streamnfl_cowboys_vs_ravens_live_streamreddit/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9fmuz/officiallivestream_baltimore_ravens_vs_dallas/

https://www.reddit.com/r/RavensvsCowboyslives/comments/k9fmve/officialcrackstreams_baltimore_ravens_vs_dallas/

https://www.reddit.com/r/RavensvsCowboyslives/comments/k9anvl/streamofficialdallas_cowboys_vs_baltimore_ravens/

https://www.reddit.com/r/RavensvsCowboyslives/comments/k9anvy/official_livestrem_dallas_cowboys_vs_baltimore/

https://www.reddit.com/r/RavensvsCowboyslives/comments/k9anwa/officialcowboys_vs_ravens_live_streamsreddit2020/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9anwp/official_livestrem_baltimore_ravens_vs_dallas/

https://www.reddit.com/r/RavensvsCowboyslives/comments/k9anx0/official_livestrem_cowboys_vs_ravens_live/

https://www.reddit.com/r/RavensvsCowboyslives/comments/k9anxc/officiallivestream_baltimore_ravens_vs_dallas/

https://www.reddit.com/r/RavensvsCowboyslives/comments/k9anxm/nfl_baltimore_ravens_vs_dallas_cowboys_live/

https://www.reddit.com/r/RavensvsCowboyslives/comments/k9anxw/matchthreadravens_vs_cowboys_live_streams_reddit/
https://www.reddit.com/r/RavensvsCowboyslives/comments/k9ansp/officialtv_cowboys_vs_ravens_live_streamsreddit/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9ansk/livestreamofficialcowboys_vs_ravens_live_streams/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9ansv/officiallivetvcowboys_vs_ravens_live_streamsreddit/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9ant8/officialcowboys_vs_ravens_live_streamsreddit/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9antt/officiallivestrem_cowboys_vs_ravens_live/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9antm/officialreddit2020cowboys_vs_ravens_live/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9anu8/streamofficial_cowboys_vs_ravens_live_streamreddit/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9anul/officiallivestream_2020cowboys_vs_ravens_live/

https://www.reddit.com/r/CowboysvsRavenslive/comments/k9anv4/streamofficialbaltimore_ravens_vs_dallas_cowboys/

https://uefalive.substack.com/p/how-to-watch-dallas-cowboys-vs-baltimore

https://uefalive.substack.com/p/how-to-watch-dallas-cowboys-vs-baltimore-f67/comments

https://www.posts123.com/post/1097671/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

https://www.topfind88.com/post/1097673/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

https://caribbeanfever.com/photo/albums/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free-1

https://caribbeanfever.com/photo/albums/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

http://officialguccimane.ning.com/photo/albums/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

http://network-marketing.ning.com/profiles/blogs/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

http://www.onfeetnation.com/profiles/blogs/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

http://facebookhitlist.com/profiles/blogs/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

http://recampus.ning.com/profiles/blogs/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

http://millionairex3.ning.com/profiles/blogs/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

http://beterhbo.ning.com/profiles/blogs/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

http://korsika.ning.com/profiles/blogs/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

http://sfbats.ning.com/profiles/blogs/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

http://summerschooldns.ning.com/profiles/blogs/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

http://zacriley.ning.com/profiles/blogs/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

http://divasunlimited.ning.com/profiles/blogs/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

https://www.mydigoo.com/forums-topicdetail-205660.html

http://www.clashofclans-tools.com/Thread-35204/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

https://lemon.shivtr.com/forum_threads/3278859

https://www.peeranswer.com/question/5fd01325a3a058c24de10977

https://jsfiddle.net/ranzusdh/

https://onmogul.com/stories/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

https://paiza.io/projects/N6rDrXZWDg_Vh9LvEYBF2w?language=php

https://www.postads.ph/ad/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free

https://www.tunwalai.com/story/501378/how-to-watch-dallas-cowboys-vs-baltimore-ravens-free?page=1&target=none

https://www.dancehalldatabase.com/forum/Dancehall-Reggae/How-to-watch-Dallas-Cowboys-vs-Baltimore-Ravens-free-/fe9de7041388eb8ed9ed759a00b3809c/8841

Prerequisites

  • Basic understanding of web services(GET & POSTrequests).
  • Basic knowledge of JSON.
  • Minimal Javascript experience.

Setting Up The Sheet

The first thing we need to set up is the sheet that we are going to use to capture the data.

Navigate to Tools -> Script Editor. This will open a new tab for an Apps Script editor.

Script editor

Creating the Web Server

To collect data we need to be able to capture the GET or POST request sent by the data source. To do this we can use the doGet and doPost function. Here is a sample code with both the functions:

Sample Function

You can add the code to the Code.js file in the Apps Scripts tab. The code is simple. The doGet and doPost functions are used to process GET and POST requests respectively.

Most of the time, data is sent as a POST requests, so I will focus on the doPost function. The doPost function parses the JSON data using JSON.parse() from the request body(e.postData.contents) and appends the sheet with a new row with the data I require.

Apps Scripts can also parse CSV & XML Data.

Now we require a URL to send the requests to.

Deploying the Web App

Navigate to Publish -> Deploy as web app… on the Apps Scripts tab.

After a few seconds, a menu will pop-up:

Deploy as web app screen

The URL for the web app will be listed on the top. Copy it. The URL will remain the same for each deployment.

Every time you change the code and deploy a new version set the Project version to New.

Set Execute the app as to Me.

The last field is Who has access to the app. Set this to Anyone, even anonymous.

This will allow anyone with the web app URL to send requests to it. You can always secure it with token authentication.

Once done, click the Update button.

Testing the Functions

To test if you have set up the Apps Script correctly simply copy the URL that is generated from the previous step and open it in a browser. The doGet function returns this response:

If the page does not open or it asks you to login, make sure your code is correct and you have deployed the Apps Script with the above configuration.

To test the doPost function I will send a few POST requests to the URL using Postman. This is the sample data I will use:

You can see in the GIF below, the Live Orders sheet gets updated automatically as I send the POST request.

--

--