Class DataSourceRefreshSchedule
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Lịch biểuLàm mớiNguồndữ liệu
Truy cập và sửa đổi lịch làm mới hiện có. Để xem tất cả lịch làm mới, hãy xem Spreadsheet.getDataSourceRefreshSchedules()
.
Chỉ sử dụng lớp này với dữ liệu được kết nối với cơ sở dữ liệu.
Tài liệu chi tiết
getFrequency()
Lấy tần suất làm mới theo lịch, chỉ định tần suất và thời điểm làm mới.
Cầu thủ trả bóng
DataSourceRefreshScheduleFrequency
– Tần suất làm mới theo lịch.
Ủy quyền
Các tập lệnh sử dụng phương thức này yêu cầu được uỷ quyền với một hoặc nhiều phạm vi sau:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getScope()
Lấy phạm vi của lịch làm mới này.
Cầu thủ trả bóng
DataSourceRefreshScope
– Phạm vi làm mới.
Ủy quyền
Các tập lệnh sử dụng phương thức này yêu cầu được uỷ quyền với một hoặc nhiều phạm vi sau:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getTimeIntervalOfNextRun()
Lấy khoảng thời gian của lần chạy tiếp theo theo lịch làm mới này. Chỉ áp dụng nếu bạn bật lịch làm mới này.
Cầu thủ trả bóng
TimeInterval
– Khoảng thời gian của lần chạy tiếp theo.
Ủy quyền
Các tập lệnh sử dụng phương thức này yêu cầu được uỷ quyền với một hoặc nhiều phạm vi sau:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
isEnabled()
Xác định xem lịch biểu làm mới này có được bật hay không.
Cầu thủ trả bóng
Boolean
– Liệu lịch làm mới này có được bật hay không.
Ủy quyền
Các tập lệnh sử dụng phương thức này yêu cầu được uỷ quyền với một hoặc nhiều phạm vi sau:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eDataSourceRefreshSchedule\u003c/code\u003e allows you to access and modify the refresh schedule of data connected to a database in Google Sheets.\u003c/p\u003e\n"],["\u003cp\u003eYou can get details like refresh frequency, scope, next run time window, and whether the schedule is enabled.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides methods like \u003ccode\u003egetFrequency()\u003c/code\u003e, \u003ccode\u003egetScope()\u003c/code\u003e, \u003ccode\u003egetTimeIntervalOfNextRun()\u003c/code\u003e, and \u003ccode\u003eisEnabled()\u003c/code\u003e to manage the refresh schedule.\u003c/p\u003e\n"],["\u003cp\u003eUsing these methods requires authorization with specific scopes, such as \u003ccode\u003ehttps://www.googleapis.com/auth/spreadsheets\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Class DataSourceRefreshSchedule\n\nDataSourceRefreshSchedule\n\nAccess and modify an existing refresh schedule. To get all refresh schedules, see [Spreadsheet.getDataSourceRefreshSchedules()](/apps-script/reference/spreadsheet/spreadsheet#getDataSourceRefreshSchedules()).\n\n\n**Only use this class with data that's connected to a database.** \n\n### Methods\n\n| Method | Return type | Brief description |\n|-----------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|\n| [getFrequency()](#getFrequency()) | [DataSourceRefreshScheduleFrequency](/apps-script/reference/spreadsheet/data-source-refresh-schedule-frequency) | Gets the refresh schedule frequency, which specifies how often and when to refresh. |\n| [getScope()](#getScope()) | [DataSourceRefreshScope](/apps-script/reference/spreadsheet/data-source-refresh-scope) | Gets the scope of this refresh schedule. |\n| [getTimeIntervalOfNextRun()](#getTimeIntervalOfNextRun()) | `Time``Interval` | Gets the time window of the next run of this refresh schedule. |\n| [isEnabled()](#isEnabled()) | `Boolean` | Determines whether this refresh schedule is enabled. |\n\nDetailed documentation\n----------------------\n\n### `get``Frequency()`\n\nGets the refresh schedule frequency, which specifies how often and when to refresh.\n\n#### Return\n\n\n[DataSourceRefreshScheduleFrequency](/apps-script/reference/spreadsheet/data-source-refresh-schedule-frequency) --- The refresh schedule frequency.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n### `get``Scope()`\n\nGets the scope of this refresh schedule.\n\n#### Return\n\n\n[DataSourceRefreshScope](/apps-script/reference/spreadsheet/data-source-refresh-scope) --- The refresh scope.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n### `get``Time``Interval``Of``Next``Run()`\n\nGets the time window of the next run of this refresh schedule. Only applies if this refresh\nschedule is enabled.\n\n#### Return\n\n\n`Time``Interval` --- The time window of the next run.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n### `is``Enabled()`\n\nDetermines whether this refresh schedule is enabled.\n\n#### Return\n\n\n`Boolean` --- Whether this refresh schedule is enabled.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`"]]