Database Reference
In-Depth Information
cell that has the
// project ID to use, then picking the the 'Set
project" menu item
// from the BigQuery menu. Note that after you set
the project ID,
// you can delete that cell… the project ID is
remembered as part
// of the user properties for the script.
menuEntries.push({name: "Set project", functionName:
"setProject"});
ss.addMenu("BigQuery", menuEntries);
}
/**
* Sets the project ID to use for BigQuery queries.
User
* should select a cell containing the desired project
ID
* and then call the setProject menu item.
*/
function setProject() {
var sheet = SpreadsheetApp.getActiveSheet();
var cell = sheet.getActiveCell();
var value = cell.getValue();
if (value) {
projectId = String(value);
UserProperties.setProperty(PROJECT_ID_PROPERTY,
projectId);
Logger.log('Project ID set to %s', projectId);
} else {
Logger.log('Project ID not set');
}
}
/**
* Gets the project ID property.
*/
function getProjectId() {
Search WWH ::




Custom Search