Google Forms

From Hornbill
Revision as of 22:01, 27 January 2022 by Jamesa (talk | contribs)
Jump to navigation Jump to search
Home > Integrations > Google Forms Index

Introduction

The Google Forms Integration allows you to interact with the Service Manager app by allowing Google forms to create new requests or to interact with existing requests. Using Google Forms can provide another path into Service Manager for the creation of new requests based on a set of questions within the Google Forms. Using the request's BPM Workflow, additional information can be requested using Google Forms and stored back into a request's custom fields.

Related Articles

External Links

At a Glance

Update an Existing Request

The following steps will be used to allow for a Google Form link to be sent via email from an existing request using either the BPM Workflow or an Auto Task.

  1. Setup an API Key
  2. Create Your Google Form
  3. Adding the Integration Script
  4. Customizing the Integration Script
  5. Add a Trigger
  6. Create a Pre-filled Link
  7. Add the Pre-filled Link to an Automated Email
  8. Map Questions to Custom Fields

Setup an API Key

The creation of an API Key allows for secure authentication for the Google Forms to interact with Hornbill. The API Key will be used within the Integration Script

  1. Open the Admin Portal
  2. Navigate to System > Organizational Data > Users
  3. Select a user that you wish Google Forms to authenticate as. This user will required the rights needed to create and modify requests in Service Manager
  4. On the User Account, select the API Key tab
  5. Create a new API Key using the name Google Forms
  6. Keep this page available to you as you will need to copy the API Key into the Integration Script.

(Top of Page)

Create Your Google Form

This part of the setup requires that you have a Google account.

  1. Open your Internet Browser and navigate to google.com and login into the account you wish to use to create the Form
  2. From the Google Apps menu, find the Forms app and select to open
  3. Under the Start a New Form section select Blank
  4. Add a title to your form
  5. Click on the default question that has been provided
  6. Change Untitled Question to Request Reference. This first question will be used to hold the Request ID that it is linked with and will be prepopulated (Create a Pre-filled Link)
  7. Change the question type to Short Answer
  8. At this point you can optionally add more questions, but it is not required. Additional questions will be covered in Map Questions to Custom Fields
  9. Keep this browser tab open as you need it in the next step

(Top of Page)

Adding the Integration Script

This section will take you through taking the provided example script and adding it to your Google Form.

  1. View the Example Script that is provided on GitHub (Use CTRL key to open in new tab)
  2. Copy the entire contents of the script by clicking on the Copy Raw Contents button
  3. View the browser tab where your Google Form is located
  4. Click on the More Menu (vertical ellipse button next to your profile picture) and select Script
  5. Click on Untiled Project and give your project a name
  6. Delete all of the default text in the code.gs window so you have a blank space
  7. Paste the text that was copied from the Example Script
  8. Save the script
External Links

(Top of Page)

Add a Trigger

Triggers are created to specify what happens when someone finishes and submits a form. The trigger will link to the functions within the newly created script.

  1. On the left vertical menu bar, click on the clock which will open the Triggers page
  2. Click on + Add Trigger (bottom right)
  3. Under the option Choose which function to run make sure that OnSubmit it selected
  4. Unser Select Event Type make sure that On form submit is selected
  5. Click Save.
  6. You may be presented with a dialog box asking you to select your google account
  7. You may be presented a warning message saying that Google hasn’t verified this app. Click Advanced and then at the bottom select Go to project (unsafe)
  8. You may be presented a dialog box saying your project wants to access your Google Account. Scroll to the bottom and select Allow
  9. You may receive a Security Alert email in your Google mailbox
  10. Click Save again.

(Top of Page)

Customizing the Integration Script

At the top of the Script there are 2 key lines that needed editing

  • The text yourapikey needs to be replaced with the key that we generated in the section:
{{{2}}}
  • The text 'yourinstanceid' needs to be replaced with your instance ID. This can be found within the URL that connects you to your Hornbill. This should be all lowercase.
{{{2}}}

(Top of Page)

Create a Pre-filled Link

(Top of Page)

Add the Pre-filled Link to an Automated Email

(Top of Page)

Map Questions to Custom Fields

(Top of Page)