With a simple script, you can set up a Google Form that your users can use to input data to a Fusion Table. The script takes advantage of Google's AppsScript tool to transfer new form input into your table.
For security reasons, make sure you have a "role" gmail account to use to complete these instructions. A role account is an account that is not your personal or work email address, but one that is created for a specific task. Your password will be shown in clear in the Script Editor, so make sure you use a role account to run this script.
If you don't have a role account, create one now.
Plan out your data. If you are collecting geographic data that contains a street address such as "1600 Amphitheatre Parkway, MV, 94043" or a text location string such as "Yosemite Park" and you need Fusion Tables to geocode them for you, there are some additional steps to follow (noted below).
Also note that once you have started collecting data, you can not make any changes to the form or Fusion Table.
If you can't find Fusion Tables in the list of apps, try these steps: Fix: Not in Google Drive menus.
Add each of the following rows, replacing the name and value placeholders:
Name | Value to use | Notes |
---|---|---|
username | The username of the account that owns the table. | Use a role account. This does not work with gmail accounts that have 2-step verification enabled. |
password | The password of the account that owns the table. | This shows up in clear, so use a role account. |
docid | The identifier of your table. | To find this value, select File > About in the table menu. Copy the value next to Encrypted id. |
If you collect location data, also add these properties:
Name | Value to use | Notes |
---|---|---|
addressColumn | The exact name of the column in your table that contains the address. Do not use quotes. | If your data is already geocoded, you do not need this property. |
latlngColumn | The exact name of the location column you added to your table. | When the form data is submitted, the script geocodes the data in the addressColumn, and saves the lat/lng coordinates in this column. |
Make sure you have added the location column to your table and have added these
properties before you run the script.
You cannot change your table once you start using the script.
Click Save to save the custom properties.
The code uses the Fusion Tables API, for which you need an API key. Follow these instructions and then put the key in near the top of the code:
var API_KEY = 'YOUR API KEY HERE';
sync
method periodically.
From the Google Form, click the blue Send Form button and choose one of these sharing options:
Once people start submitting form entries and the synchronization has run, you will see a new column in your spreadsheet called "rowid". This holds the unique numbers used by Fusion Table to identify rows; these are used by the script to apply updates and deletions correctly.
Don't change the rowids — that could cause the synchronization to have unexpected results.