Giter VIP home page Giter VIP logo

google-sheets-integration's Introduction

Readme

This repo is a script to push data from a Google Drive spreadsheet to Stitch.

PLEASE NOTE:
This script is not supported by Stitch as an integration. Please feel free to contribute to this repository.

Requirements

This connector assumes you have headers in in the spreadsheet in row 1 of the spreadsheet.
This connector will not work if you define more than 8 columns as keys. The tab name must only include alpha-numeric characters. Remove spaces, or replace with underscores. You should make sure to set the columns to the correct data formats. For example, if a column contains all integers, please make sure it is not formatted as plain text.

Installation & Set-up

  1. Open the spreadsheet you would like to push to Stitch.

  2. Click Tools, Script Editor. Click Close on the Popup, or choose blank project.

  3. Delete the contents of the file currently open

  4. Copy the contents from this folders's sheetstostitch.gs page, and paste into the 'code.gs' script file you have open.

  5. Go back to the spreadsheet and refresh the page. If you don't see a new dropdown in the toolbar titled "Stitch Import", close the spreadsheet and re-open it.

  6. In the "Stitch Import" dropdown, click "Setup Spreadsheet for Push". You'll need to authorize the script to access the data, so log in with the Google account that has access to this sheet.

  7. Enter API key and Client ID provided in your Stitch account.

  8. Choose which columns act as the unique key for your table. These columns must be unique for all current and future rows of this table. If you have multiple columns that make up the unique key, it's recommended that you hash them together using the md5 Google Sheets function.

    More on using the md5 function

    To use this handy function in Google Sheets, enter the contents of the md5_sheets.gs file into Tools --> Script Editor. Then, to create a unique key in your sheet based on multiple columns, create an 'ID' column and in its cells enter " =md5(cell1&cell2&cellN) " where cells 1,2...N are the cells that make up your unique key. Make sure to format numbers or dates as text before using them in an md5 function to ensure the data being used to generate your unique key are in a specified format. If you plan to join this table to other data models based on this key, make sure the output matches what your warehouse generates from "select md5('cell1 contents' || 'cell2 contents' || 'cellN contents')". For more information on the function and its uses, check here and here.

Pushing another tab

If you store data in another tab that you would like to also push to the Stitch Import API, you'll need to set up the keys in that sheet as well. You can do so by clicking on that tab, and following the directions below.

  1. In the "Stitch Import" dropdown, click "Setup Spreadsheet for Push".
  2. Click "Cancel" on the API Key options and CID options.
  3. Choose the keys(s) in this tab that make each row unique. Enter the relevant column headers exactly as you have them in the sheet. If more than one, it's recommended that you hash them together using the md5 Google Sheets function.

Syncing Data

  1. Once you are ready to push data to Stitch, in the "Stitch Import" dropdown, click "Sync with Stitch".
  2. Once data has replicated to your warehouse, query it to make sure it looks right and has all of the rows you need.

Issues

If you encounter any errors, please open an issue in this repo. If you find a solution to a problem, submit a pull request.

LICENSE

The MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

google-sheets-integration's People

Contributors

fred-shaykis avatar henryhund avatar lee-schlesinger avatar shaunymca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-sheets-integration's Issues

FYI: Do not use the new Apps Scripts Runtime

If you use the new Apps Script Runtime, there will be an error on line 127 for syntax. I know absolutely 0% about the GS language so I don't know why. Make sure this is not enabled

image

ScriptProperties API is deprecated.

ScriptProperties API is deprecated.
File: Code Line: 89
The API has been marked as deprecated which means that the feature should be avoided and may be removed in the future. Consider using an alternative solution.

Error with larger import

When trying to send over a larger spreadsheet and we are encountering this error

Request failed for https://api.stitchdata.com/v2/import/push returned code 413. Truncated server response: <title>413 Request Entity Too Large</title>

413 Request Entity Too Large

<... (use muteHttpExceptions option to examine full response)

The spreadsheet currently has 37 columns and 14000 rows. Some of the columns have larger strings.

Anyway to get around this? We tested and it looks like if we remove some columns to reduce the payload, we can get it to go through but that doesn't help us.

Thanks

Columns split between float and int (e.g. SALES_FL and SALES_IT) in snowflake

The script is putting numbers it assumes are floats into one column and integers into another column for the same source column in gsheets.

For example, I have a SALES column with numbers like 0.5, 1.2, and occasionally 0.

The script is creating two columns, SALES_FL and SALES_IT, where the SALES_FL has values 0.5, 1.2 while the SALES_IT has the 0 values.

How can i ensure that columns will not be split up based on inferred data type (i.e. the 0s in float columns are translated into 0.00)?

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.