Class DataSourceRefreshScheduleFrequency

  • Access a refresh schedule's frequency which specifies how often and when to refresh data connected to a database.

  • Use DataSourceRefreshSchedule.getTimeIntervalOfNextRun() to see the next scheduled run time.

  • Update the frequency using DataSourceRefreshSchedule.setFrequency(newFrequency).

  • Methods are available to get details like the days of the month or week, the frequency type, and the start hour of the refresh schedule.

DataSourceRefreshScheduleFrequency

Access a refresh schedule's frequency, which specifies how often and when to refresh.

Only use this class with data that's connected to a database.

To see the next time this refresh schedule is scheduled to run, use DataSourceRefreshSchedule.getTimeIntervalOfNextRun() .

To update, use DataSourceRefreshSchedule.setFrequency(newFrequency).

Methods

MethodReturn typeBrief description
getDaysOfTheMonth() Integer[]Gets the days of the month as numbers (1-28) on which to refresh the data source.
getDaysOfTheWeek() Weekday[] Gets the days of the week on which to refresh the data source.
getFrequencyType() FrequencyType Gets the frequency type.
getStartHour() IntegerGets the start hour (as a number 0-23) of the time interval during which the refresh schedule runs.

Detailed documentation

getDaysOfTheMonth()

Gets the days of the month as numbers (1-28) on which to refresh the data source. Only applies if frequency type is monthly.

Return

Integer[] — The days of the month on which to refresh.

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

getDaysOfTheWeek()

Gets the days of the week on which to refresh the data source. Only applies if the frequency type is weekly.

Return

Weekday[] — The days of the week on which to refresh.

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

getFrequencyType()

Gets the frequency type.

Return

FrequencyType — The frequency type.

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

getStartHour()

Gets the start hour (as a number 0-23) of the time interval during which the refresh schedule runs. For example, if the start hour is 13 and the time interval's duration is 4 hours, then the data source is refreshed between 1 p.m. and 5 p.m. The hour is in the timezone of the spreadsheet.

Return

Integer — The start hour.

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

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024年12月02日 UTC.