Skip to content

Use Apps Script to fill and send a RabbitSign document whenever a Google Form is submitted.

License

Notifications You must be signed in to change notification settings

scottleechua/googleform-to-rabbitsign

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Form to RabbitSign

Use Apps Script to fill and send a RabbitSign document whenever a Google Form is submitted.

A side-by-side image showing a filled Google Form on the left and the generated, filled-up form on the right with matching form details.

You can examine the Apps Script code that powers this demo here.

Requirements

  1. A completed RabbitSign document template. Note down the sender field names, recipient's role name, and the template ID.
  2. A Google Form that collects the information to be injected into the RabbitSign document (at minimum, the recipient's name and email address).
  3. RabbitSign API credentials stored in Google Cloud Secret Manager in the format:
{"id":"<APIKEYID>","secret":"<APIKEYSECRET>"}

replacing <APIKEYID> and <APIKEYSECRET> with your actual credentials.

Instructions

For a complete walkthrough, read this blog post.

For the basic steps, click here.

A. Setup Apps Script

  1. From your Google Form, click the 3-dots icon in the upper right and select Apps Script.
  2. This creates a new Apps Script project linked to the Google Form. Give the project a meaningful title, as this will show up as a "Third-party app" in your Google account.
  3. In the Apps Script project, go to Project Settings (the gear icon in the left-hand side menu) and tick "Show appsscript.json manifest file in editor".
  4. Open appsscript.json and add a new entry:
"oauthScopes": [
      "https://www.googleapis.com/auth/script.external_request",
      "https://www.googleapis.com/auth/cloud-platform",
      "https://www.googleapis.com/auth/forms"
    ]

remembering to add a comma after the previous argument.

  1. Copy in main.gs, utils.gs from this repo.

  2. Go to Triggers (the alarm clock in the left-hand side menu) and Add Trigger.

    Change "Select event type" to On form submit, and "Failure notification settings" to Immediately. Leave the rest at their default values and hit Save.

    This should initiate an authentication flow to grant the project the necessary permissions.

B. Customize main.gs

  1. Update lines 2-4 with details of the Secret you stored in Google Cloud Secret Manager.
  2. Update lines 5-8 with details of your RabbitSign document.
  3. On line 29, specify which Google Form question contains the respondent's name.
  4. If you collected the respondent's email using Google Forms' "Collect email addresses" feature, uncomment line 33.
  5. If you collected the respondent's email manually (by creating a question), uncomment line 35 and modify it as required.
  6. Below line 39, map Google Form questions to RabbitSign fields.
  7. Submit some test responses to the Google Form and use Apps Script's Execution log to debug.
  8. All done!

Pricing

  • Google Forms & Apps Script: free.
  • RabbitSign: Up to 10 free documents created via API, and 0.10 USD per document thereafter. Refer to the Developer Page.
  • Secret Manager: Up to 6 active secrets and 10k access operations free per month under the Google Cloud Free Tier.

Acknowledgements

Contribute

For bug reports or features, please open an issue before making a pull request.

About

Use Apps Script to fill and send a RabbitSign document whenever a Google Form is submitted.

Resources

License

Stars

Watchers

Forks