I keep getting this error
"ReferenceError: "BigQuery" is not defined. (line 19, file "Code")"
when trying to this script in apps script
function saveQueryToTable() {
var projectId = 'fiery-cabinet-****';
var datasetId = '11234***1';
var tableId = 'TEST4';
var job = {
configuration: {
query: {
query: 'SELECT *' +
'FROM Test2;',
destinationTable: {
projectId: projectId,
datasetId: datasetId,
tableId: tableId
}
}
}
};
var queryResults = BigQuery.Jobs.insert(job, projectId);
Logger.log(queryResults.status);
}
Could anyone let me know where I'm going wrong?
Thanks
You need to enable the BigQuery service.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With