{"id":13565902,"url":"https://github.com/techcoop/form-google-sheets","last_synced_at":"2025-04-03T23:30:43.732Z","repository":{"id":57240278,"uuid":"95488729","full_name":"techcoop/form-google-sheets","owner":"techcoop","description":"Uses Google Apps Scripts with Google Sheets to provide a POST endpoint for form data that is parsed into sheet fields.","archived":false,"fork":false,"pushed_at":"2018-01-03T17:05:50.000Z","size":69,"stargazers_count":11,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T00:21:14.993Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techcoop.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-26T20:54:48.000Z","updated_at":"2025-03-15T00:14:25.000Z","dependencies_parsed_at":"2022-09-05T07:51:25.845Z","dependency_job_id":null,"html_url":"https://github.com/techcoop/form-google-sheets","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techcoop%2Fform-google-sheets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techcoop%2Fform-google-sheets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techcoop%2Fform-google-sheets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techcoop%2Fform-google-sheets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techcoop","download_url":"https://codeload.github.com/techcoop/form-google-sheets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247097607,"owners_count":20883121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:01:57.526Z","updated_at":"2025-04-03T23:30:42.915Z","avatar_url":"https://github.com/techcoop.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# form-google-sheets\n[![Maintenance Status][status-image]][status-url] [![NPM version][npm-image]][npm-url] [![Travis build][travis-image]][travis-url]\n\nUses Google Apps Scripts with Google Sheets to provide a POST endpoint for form \ndata that is parsed into sheet fields.\n\nhttps://techcoop.github.io/form-google-sheets/\n\n# Requirements\n\n1) Google Account\n2) Google Sheet with column headers\n3) node \u003e 6.0.0 (Optional)\n4) yarn (or npm latest) \u003e 0.10.0 (Optional)\n\n# Installation\n\n### Google Scripts\n\n1) Create a google sheet\n2) Make the first column \"timestamp\"\n3) Click on \"Tools\" \u003e \"Script Editor...\"\n4) Name your project something memorable\n5) Replace contents of code.gs with [this file](https://github.com/techcoop/form-google-sheets/blob/master/src/GoogleScript/Code.gs)\n6) Change the name of your tab in the sheet\n7) Update the variable \"SHEET_NAME\" in the code from step 5\n8) Add columns you want as fields in your form, the fields should match your HTML exactly\n9) Add any required fields with messages to the \"fields\" object\n10) Edit the \"testData\" to match your sheet fields\n11) Click on Run \u003e Run Function \u003e \"test_post\"\n12) Confirm this data is inserted into your sheet\n13) If everything works, Click on Publish and select \"Deploy as web app\"\n14) Select new and type a version name (e.g 0.1.0) (or update existing)\n15) In \"Execute the app as\" select yourself\n16) In \"Who has access to the app\" Select \"Anyone, even anonymous\"\n17) Click Deploy or Update\n18) Click \"Review Permissions\", to Authorize application\n19) When you see a warning, Click \"Advanced\" and \"Go to PROJECT_NAME\"\n20) Review list of  permissions required, and click \"Allow\"\n21) Copy and paste URL (note: if you're logged into multiple Google accounts you'll [have to manually remove \"/u/0\" or similar from the URL](https://stackoverflow.com/a/47050007/4869657) to avoid errors)\n22) Setup your HTML form to post to the URL from step 21\n\n### NPM package\n\n```bash\nyarn add form-google-sheets\n```\n# Usage\n\n### ES6\n```javascript\nimport { Form } from 'form-google-sheets'\n\nconst endpoint = 'https://script.google.com/macros/s/AKfycbyEBGqfIUmxrLKMp_LlAlH8C_VO9vfRvtvwgjAS9lEi8Vu8xho/exec'\nconst form = new Form(endpoint).then((event) =\u003e {\n  console.log('SUCCESS')\n  console.log(event)\n}).catch((event) =\u003e {\n  console.log('ERROR')\n  console.log(event)\n})\n```\n\n### Node\n```javascript\nvar Form = require('form-google-sheets').Form\n\nvar endpoint = 'https://script.google.com/macros/s/AKfycbyEBGqfIUmxrLKMp_LlAlH8C_VO9vfRvtvwgjAS9lEi8Vu8xho/exec'\nvar form = new Form(endpoint).then((event) =\u003e {\n  console.log('SUCCESS')\n  console.log(event)\n}).catch((event) =\u003e {\n  console.log('ERROR')\n  console.log(event)\n})\n```\n\n### Javascript\n```html\n\u003cscript src=\"form-google-sheets.js\"\u003e\u003c/script\u003e\n```\n\n```javascript\nvar endpoint = 'https://script.google.com/macros/s/AKfycbyEBGqfIUmxrLKMp_LlAlH8C_VO9vfRvtvwgjAS9lEi8Vu8xho/exec'\nvar form = new FormGoogleSheets.Form(endpoint).then(function(event) {\n  console.log('SUCCESS')\n  console.log(event)\n}).catch(function(event) {\n  console.log('ERROR')\n  console.log(event)\n})\n```\n\n# Testing\n\n### Google Scripts\nThere is a test function setup that you can change to include your own fields and make sure your form is setup correctly.\n\n1) Change the testData in test_post()\n2) Move to Run in the top menu\n3) Click function test_post()\n\n### Client library\n\n```bash\n# Run unit test\nyarn test\n```\n\n# Releasing\n```bash\n# Create new versioned release\nyarn run release\n```\n\n# Examples\n\nYou can see examples of use in javascript under /docs.\n\nYou can see the (view only) sheet that this posts to here:\nhttps://docs.google.com/spreadsheets/d/1SRRfFOpIJyW6tZB1TP3wJf01CFISviIMFEJDgwoqq5w/edit?usp=sharing\n\n# Original Source\nhttps://github.com/dwyl/html-form-send-email-via-google-script-without-server\n\n# Contributing\nAll contributors are welcome, please follow [CONTRIBUTING.md](guidelines)\n\n# Contributors\n[colin@techcoop.group](admin) \n\n[admin]: https://github.com/colingagnon\n\n[status-image]: https://img.shields.io/badge/status-maintained-brightgreen.svg\n[status-url]: https://github.com/techcoop/form-google-sheets\n\n[npm-image]: https://img.shields.io/npm/v/form-google-sheets.svg\n[npm-url]: https://www.npmjs.com/package/form-google-sheets\n\n[travis-image]: https://travis-ci.org/techcoop/form-google-sheets.svg?branch=master\n[travis-url]: https://travis-ci.org/techcoop/form-google-sheets\n\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg\n[license-url]: https://raw.githubusercontent.com/techcoop/form-google-sheets/master/LICENSE\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechcoop%2Fform-google-sheets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechcoop%2Fform-google-sheets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechcoop%2Fform-google-sheets/lists"}