Script to create a file from Google form - Can be transform into a static CMS generator
- Go on form: https://forms.gle/XwZVMZjpzhyKP4qT8
- feel the info of the form
- info is commited to
gform
branch in directorydemo/responses
To create your how project need to have:
- a github project with a branch call
gform
- a Personal Access Token for github with scope
repo
- you can created via https://github.com/settings/tokens
Create a Google Form and associated a Google Spreadsheet to it. You can for example duplicate this form : https://docs.google.com/forms/d/1cyaYx6pV0G5XhZqJ0Jhs3Oe0K-xqzBTQmQ4Eb4ZYB-k/edit?usp=sharing
Open the Google Spreadsheet and go on tools > Script Editor
Copy-past the content of connect-gform-to-github.gs
.
You then need to adapt the following global variables:
- YOUR_USERNAME
- YOUR_REPO
- GITHUB_KEY
You then need to adapt the function createJsonFileContent
to match the value return by your Google form
On the script app go Edit > Current project's triggers
Add a trigger with following values:
- Choose which function to run: onFormSubmit
- Select event source: From Spreadsheet
- Select event type: On Form submit
You can find the log execution of the function in: https://script.google.com/home/executions