Giter VIP home page Giter VIP logo

reactor-gsheet-add-row's Introduction

reactor-gsheet-add-row

Reactor Extension script that adds a row to a Google Sheet spreadsheet each time an appropriate action is created. The action's customFields contain an object whose keys are Sheet column headings, and values are the values for the new row.

Installation

  1. git clone https://github.com/evrythng/reactor-gsheet-add-row
  2. Copy main.js to a Reactor script configuration screen in the EVRYTHNG Dashboard on an application details page.
  3. Set up the configuration values as detailed in Usage below.

Usage

  1. Create a Google Sheet and note the ID in the URL, or use an existing one.
  2. Enter the headers in row 1 - these will be customFields keys.
  3. Create a Service Account in Google API Console (with Sheets API enabled) and save the credentials JSON file offered.
  4. Share the Sheet with the Service Account user by email address with the edit permission enabled.
  5. Set the SHEET_ID, then the SECRET_CREDS in the Reactor script with values from the downloaded JSON file, then save the Reactor script.
  6. Create an action of type _AddRow with row data as customField values. An example is shown below:
POST /actions/_AddRow
Content-Type: application/json
Authorization: $TRUSTED_APPLICATION_API_KEY

{
  "type": "_AddRow",
  "customFields": {
    "Index": "1",
    "Date": "21/12/18",
    "Updated": "28397",
    "Deleted": "23"
  }
}

The above will result in the following sheet layout (if it was the first row added):

Index  Date      Updated  Deleted
1      21/12/18  28397    23

Each subsequent action will add another row from the first blank row found, from the top of the worksheet.

Note: Due to how google-spreadsheet works, there can be no blank rows, and the headers must be in row 1.

reactor-gsheet-add-row's People

Contributors

c-d-lewis avatar

Watchers

 avatar  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.