Code Monkey home page Code Monkey logo

gsbot's Introduction

GSBot

GSBot is an Apps Script powered Google Spreadsheet Bot which can create submissions in spreadsheets and send webhook notifications for Hangouts Chat Rooms and Slack.

Getting Started

Installation

  • Create a new Google SpreadSheet
  • Assign column names for each field we’ll be collecting.(Place the names of each field in row 1.)
  • Go to the Tools menu and select Script editor from the dropdown.
  • Delete the code in Code.gs from the script editor
  • Click on the Untitled project project name if you want to rename your project.
  • Copy and paste the code into the script editor
  • Save. Then go to Run and click setup
  • You might be asked to give Google Scripts authorisation to use your Google account.
  • Once you’ve given your authorization, go to the Publish menu and select Deploy as web app.
  • You must execute the app as yourself and you must give Anyone, even anonymous access to the app.
  • Click on Deploy and save your web app URL for later
  • Close the Script editor window

Usage

Now all you have to do is make a GET request to the we app URL we saved before , with the data ( with the field names ) you wanna save and the sheetName you wanna save them into.

If you’re struggling to access parameters or properly pass data, try attaching them to the end of the url instead (Paste the URL in your web browser to test it out.):

https://script.google.com/macros…/exec?firstName=Shubh&lastName=Khare

Where firstName and lastName are column names in row 1 of our spreadSheet we set up earlier, and Shubh and Khare are data we want to save in our spreadsheet.

Notifications

Uncomment the part in Code.gs which is labelled as Enable notification feature here

You also have to set slackWebhook and googleChatWebhook to your webhooks.
How to get webhooks :- Slack
Google chat

Implications

One only needs to make a GET request to store information in the spreadsheet using this bot. A lot of tasks can be automated due to this reason. There's one use case I have for you. Forms are always tricky on static or only client-side applications. There are services provided by hosting websites like Netlify to store form responses, but they charge you (a lot) after certain number of submissions or after some limited time. The bot can be used to store form submissions for free no matter how many responses. That was one.It can also be used in various ways provided you're creative enough.

gsbot's People

Contributors

iamshubhankarkhare avatar

Stargazers

 avatar

Watchers

 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.