diff --git a/ImportJSON.gs b/ImportJSON.gs
index 731806e..3b2516c 100644
--- a/ImportJSON.gs
+++ b/ImportJSON.gs
@@ -71,6 +71,57 @@ function ImportJSON(url, query, parseOptions) {
return ImportJSONAdvanced(url, null, query, parseOptions, includeXPath_, defaultTransform_);
}
+/**
+ * Creates a menu which, when selected, imports a JSON feed and inserts the results after the last row in a Google Spreadsheet.
+ * The JSON feed is flattened to create a two-dimensional array. The first row contains the headers, with each column header
+ * indicating the path to that data in the JSON feed. The remaining rows contain the data.
+ * All options are the same as the "basic" ImportJSON method.
+ * The use of a menu option versus a formula-style function is *required* in order to give permissions to Google Drive to
+ * allow access to the file.
+ **/
+
+function onOpen() {
+ var ui = SpreadsheetApp.getUi();
+ ui.createMenu('Import JSON')
+ .addItem('From Google Drive File', 'ImportJSONFromDrivePre')
+ .addToUi();
+}
+
+function ImportJSONFromDrivePre() {
+
+ var rawHTML = "
Enter Drive Filename:
Enter query options (fields):
Enter parse options:
"
+ var html = HtmlService
+ .createHtmlOutput(rawHTML)
+ .setWidth(400)
+ .setHeight(250);
+ SpreadsheetApp.getUi().showModalDialog(html, 'Parse JSON From Google Drive File')
+
+}
+
+function ImportJSONFromDrivePost(driveFile, query, parseOptions) {
+
+// var fileName = "plan.json";
+
+ var files = DriveApp.getFilesByName(driveFile);
+ if (files.hasNext())
+ {
+ var file = files.next();
+ var content = file.getBlob().getDataAsString();
+ var object = JSON.parse(content);
+
+ var ss = SpreadsheetApp.getActiveSpreadsheet();
+ var result = parseJSONObject_(object, "/statistics", null, includeXPath_, defaultTransform_);
+
+// var jsondata = UrlFetchApp.fetch("https://tools.learningcontainer.com/sample-json.json", null);
+// var object = JSON.parse(jsondata.getContentText());
+// var result = parseJSONObject_(object, "/address", "noHeaders", includeXPath_, defaultTransform_);
+
+ ss.getActiveSheet().getRange(ss.getLastRow()+2, 1, result.length, result[0].length).setValues(result);
+ }
+
+ return true;
+}
+
/**
* Imports a JSON feed via a POST request and returns the results to be inserted into a Google Spreadsheet. The JSON feed is
* flattened to create a two-dimensional array. The first row contains the headers, with each column header indicating the path to