A number of my BQ-tables take their data from GSheets. However, once I run queries on these tables from Apps Script I get this error:
Access Denied: BigQuery BigQuery: No OAuth token with Google Drive scope was found.
The error refers to this code line:
var queryResults = BigQuery.Jobs.query(request, projectId);
From my BigQuery interface (Query History) I can see the unsuccessful request, and when I rerun it from there I get results and everything is ok.
Any idea how to make the query run with the script?
Thanks