Trigger fails when connecting to BigQuery and retrieving data from spreadsheet

Asked 2 years ago, Updated 2 years ago, 111 views

I wrote the process of retrieving the data aggregated by BigQuery in GAS and outputting it to a spreadsheet.

The following are the queries to retrieve:

select * from
(SELECT appid, count (userno) as cnt FROM [hogehoge.dau_20151201] 
group by appid having count (userno) > 1000)
order by cat desc

The implementation of GAS is based on what Mr. Masui of Treta introduced on his blog.
http://toreta.blog.jp/archives/20649904.html

If you say "BigQuery - > Update All Sheet Contents" in the spreadsheet, you can run it without any problems.

However, when I tried to trigger this to auto run once a day,
The following error occurs and the process fails.

runAllQueries Not found:Table hugahuga:hogehoge.dau_20151207

Is there any difference in permissions when executing with a trigger?

google-apps-script google-bigquery

2022-09-30 20:25

1 Answers

The user may be different when selected from the menu or when called by trigger.
The user you selected on the authentication screen displayed when you called the GAS from the menu for the first time, and
The user selected in the authentication screen displayed in when you set the trigger is likely to be different.

Delete the trigger once, create the trigger again, and select a user with permission as the authentication screen should appear.


2022-09-30 20:25

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.