AI-generated Key Takeaways
-
DataSourceRefreshSchedule
allows you to access and modify the refresh schedule of data connected to a database in Google Sheets. -
You can get details like refresh frequency, scope, next run time window, and whether the schedule is enabled.
-
The class provides methods like
getFrequency()
,getScope()
,getTimeIntervalOfNextRun()
, andisEnabled()
to manage the refresh schedule. -
Using these methods requires authorization with specific scopes, such as
https://www.googleapis.com/auth/spreadsheets
.
Access and modify an existing refresh schedule. To get all refresh schedules, see Spreadsheet.getDataSourceRefreshSchedules()
.
Only use this class with data that's connected to a database.
Methods
Method | Return type | Brief description |
---|---|---|
get | Data | Gets the refresh schedule frequency, which specifies how often and when to refresh. |
get | Data | Gets the scope of this refresh schedule. |
get | Time | Gets the time window of the next run of this refresh schedule. |
is | Boolean | Determines whether this refresh schedule is enabled. |
Detailed documentation
getFrequency()
Gets the refresh schedule frequency, which specifies how often and when to refresh.
Return
Data
— The refresh schedule frequency.
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getScope()
Gets the scope of this refresh schedule.
Return
Data
— The refresh scope.
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getTimeIntervalOfNextRun()
Gets the time window of the next run of this refresh schedule. Only applies if this refresh schedule is enabled.
Return
Time
— The time window of the next run.
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
isEnabled()
Determines whether this refresh schedule is enabled.
Return
Boolean
— Whether this refresh schedule is enabled.
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets