Coder Social home page Coder Social logo

riiamri23 / google-sheet-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from onescales/google-sheet-api

0.0 0.0 0.0 49 KB

Makes a Google Sheet Into a Public GET API (for reading and writing)

License: GNU General Public License v3.0

JavaScript 100.00%

google-sheet-api's Introduction

google-sheet-api

Makes a Google Sheet Into a Public GET API (for reading and writing)

The example we use is a simple one column sheet which can be read in json output and written to append to the last line.

For a visual overview and full details, see our youtube video - https://www.youtube.com/watch?v=pJOcRSEqhDk

Steps

  1. Create Google Sheet
  • Create the column and add data. (for example - "Users" as the header, "Bob" as first row (A2) and "Jason" as second row (A3)
  • Name the sheet (for example "Sheet1"). If you change this, you will need to change the value also in your API request path= (see step 5 below)
  1. Create Apps Script
  • In Google Sheet Top Menu, Click on Extensions -> App Script
  • Edit the Code.gs file and copy paste this repository Code.gs. Make sure to edit row 70 "Users" with the name of header of your column A -> rowData.push(e.parameter['Users'] || '');
  • Set a "project title" name and click on "Deploy" -> "New Deployment"
  1. Set Permissions of Apps Script and Publish Make sure to deploy as "Web app" and copy the Web App URL: https://script.google.com/macros/s/xxxxxxxxxxxxxx/exec (make sure to replace the x's with your ID)
  2. Using the Api and Testing Take the "Web App URL" and Use it in the Following Way: a. Read the Sheet
  • Add to the end of the "Web App URL" ?path=Sheet1&action=read b. Write to the Sheet (Add a new row)
  • Add to the end of the "Web App URL" ?path=Sheet1&action=write&Users=[name]
  1. Start Using It. Enjoy!

Additional Notes

  • This script before writing to bottom of sheet, will check for duplicates. It you are trying to write a value that already exists in the sheet, it will decline the new entry and let you know.
  • Make make sure to read more about sharing access with Google Sheets, Google Sheets and Apps Scripts guidelines, quotas, limitations and costs before trying to setup your own versions.
  • All code and instructions are as is. By reading this repository, readme or any code, you acknowledge that you are solely responsible for your own doings.

Hope you liked this!

Suggestions, Comments and Contact

If you have any suggestions, comments, insight or just want to say hi, thanks or share your experience, you can contact us at:

google-sheet-api's People

Contributors

onescales avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.