Giter Site home page Giter Site logo

convertigo / c8oprj-lib-googlesheets Goto Github PK

View Code? Open in Web Editor NEW
2.0 7.0 0.0 10.74 MB

This is the Google Sheets connector for Convertigo platform. Install this library to enable writing and reading from Google Sheets for your Convertigo applications

Home Page: https://www.convertigo.com

JavaScript 79.70% HTML 9.97% CSS 2.47% SCSS 7.86%
convertigo googlesheet

c8oprj-lib-googlesheets's Introduction

lib_GoogleSheet

This is the Google Sheet connector for Convertigo platform. Install this library to enable writing and reading from Google Sheets for your Convertigo applications

Installation

  • In your Convertigo Studio use File->Import->Convertigo->Convertigo Project and hit the 'Next' button

  • In the Dialog 'Project remote URL' field Paste :

      lib_GoogleSheet=https://github.com/convertigo/c8oprj-lib-googlesheets.git
    
  • And click the 'Finish' button

  • This will also automatically import the lib_OAuth project

  • Create all 'Undefined Global Symbols' when prompted

Usage

Configuring your Google OAuth and API Keys

This connector uses the OAuth authentication protocol to exchange data with Google Sheets. You must configure this in your Google APIs Console:

  • Connect to https://console.developers.google.com/apis/dashboard
  • Create a New Project and select it
  • Click ENABLE APIS AND SERVICES button
  • Search for Google Sheets API and Google Picker API and enable them
  • Click on Credentials from Google left menu
  • Click on CREATE CREDENTIALS button and select API key
  • Copy this API key and paste it in lib_GoogleSheet.picker.apikey.secret symbol value via Convertigo Administration Console
  • Click on CREATE CREDENTIALS button and select OAuth client ID (Configure consent screen if asked)
  • Choose Web application in drop-down list
  • In Authorised JavaScript origins, add http://localhost:18080 and http://localhost:8100 URIs (Convertigo Studio dev/test mode) and https://<your site>.convertigo.net (Convertigo Server prod mode)
  • In Authorised redirect URIs, add https://c8ocloud.convertigo.net/convertigo/projects/lib_OAuth/getTokenGoogle.html
  • Click CREATE button
  • Copy the Client ID key and paste it in lib_oauth.google.clientid symbol value via Convertigo Administration Console
  • Copy the Client Secret key and paste it in lib_oauth.google.keysecret.secret symbol value via Convertigo Administration Console

Configuring Convertigo Symbols

lib_GoogleSheet needs some symbols to be configured. You configure them trough the Web Console: https://<your site>.convertigo.net/admin, hit the symbols button to get to the symbol configuration page.

Symbol value
lib_oauth.google.clientid The client ID value you copied in the previous step
lib_oauth.google.keysecret.secret the Client Secret value you copied in the previous step.
lib_GoogleSheet.picker.apikey.secret the API Key value you copied in the previous Step.

Sequences

lib_GoogleSheets provides sequences you can call in your projects

Sequence Action
SheetAddRow Add a row of cells to a google Sheet
SheetGetRange Read a Range of values form a Google Sheet

These sequences will only work if you performed a OAuth Authentication to Google first. To help you with this, the library provides a Shared action you can use in your Apps.

Using in a Backend only environment.

If you want to run the Sequences headless (by APIs or within a scheduled job) then the connector will need to authenticate to Google with no end user Interaction.

This can be done in the following way :

  • The connector will have to store a Refresh Token in a Convertigo user profile. To do this it will use the lib_UserManager to store the refresh token as an User attribute. This implies that a Convertigo user account must be created. You can do this by executing the AddUser Sequence in lib_UserManager

  • When the Shared Action DisplayGoogleDrivePicker is executed, it will check if the current Convertigo session is Authenticated (If the Step SetAuthenticatedSession has been executed for this session). If it is, the Google Refresh Token will be persisted as an attribute to the current Authenticated User. Caution! This will only occur the first time a User asks access to the Google resources causing the Google Consent Screen to be displayed.

  • If you want to run a Sequence such as SheetGetRange headless (from an API of from a Scheduled job):

    • Make sure that a Convertigo Account exists and that the Google refresh token for this user is set up for this account. (See previous step).
    • Authenticate with this user by having the SetAuthenticatedUser step called.
    • Have the SheetXXX sequences called. The connector will automatically retrieve the refresh token from the authenticated user account, refresh the access token from google and perform the operation.

c8oprj-lib-googlesheets's People

Contributors

gregory-vorbe avatar nathalie-lammelin avatar opicciotto avatar

Stargazers

 avatar  avatar

Watchers

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