Skip to content

Instantly share code, notes, and snippets.

@s2t2
Created January 10, 2016 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s2t2/20e9ed22b06697f9ae12 to your computer and use it in GitHub Desktop.
Save s2t2/20e9ed22b06697f9ae12 to your computer and use it in GitHub Desktop.
Google Form Reader (Google Apps Script)

Google Form Reader

A google apps script that reads metadata from an existing Google Form.

Prerequisites:

Set a script property called FORM_ID using the File menu.

Usage

Paste the contents into a new window and run.

function getFormMetadata(){
Logger.log('MY EMAIL --> ' + Session.getActiveUser().getEmail());
var formId = PropertiesService.getScriptProperties().getProperty('FORM_ID'); // http://stackoverflow.com/a/24749707/670433
var form = FormApp.openById(formId);
Logger.log("CONF MESSAGE --> " + form.getConfirmationMessage())
Logger.log("CUSTOM CLOSED FORM MESSAGE --> " + form.getCustomClosedFormMessage())
Logger.log("DESCRIPTION --> " + form.getDescription())
Logger.log("DESTINATION ID --> " + form.getDestinationId())
Logger.log("DESTINATION TYPE --> " + form.getDestinationType())
Logger.log("EDIT URL --> " + form.getEditUrl())
Logger.log("EDITORS --> " + form.getEditors())
Logger.log("ID --> " + form.getId())
// Logger.log("______ --> " + getItemById(id))
Logger.log("ITEMS --> " + form.getItems())
// Logger.log("______ --> " + getItems(itemType))
Logger.log("PUBLISHED URL --> " + form.getPublishedUrl())
//Logger.log("______ --> " + getResponse(responseId))
Logger.log("RESPONSES --> " + form.getResponses())
//Logger.log("______ --> " + getResponses(timestamp))
Logger.log("SHUFFLE QUESTIONS --> " + form.getShuffleQuestions())
Logger.log("SUMMARY URL --> " + form.getSummaryUrl())
Logger.log("TITLE --> " + form.getTitle())
Logger.log("ONE PER USER? --> " + form.hasLimitOneResponsePerUser())
Logger.log("PROGRESS BAR? --> " + form.hasProgressBar())
Logger.log("RESPOND AGAIN LINK? --> " + form.hasRespondAgainLink())
Logger.log("ACCEPTING RESPONSES? --> " + form.isAcceptingResponses())
Logger.log("PUBLISHING SUMMARY? --> " + form.isPublishingSummary())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment