期間設定
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
データの取得時に期間が必要なデータソースを使用している場合は、Looker Studio の期間機能を活用できます。
コミュニティ コネクタの期間設定機能を有効にするには、getConfig
レスポンスで dateRangeRequired
を true
に設定します。これにより、Looker Studio でコネクタに対して行われたすべての getData
リクエストに開始日と終了日が追加されます。
dateRangeRequired
が true
の場合の getData
の動作
getConfig
レスポンスで dateRangeRequired
が true
に設定されている場合、各 getData
リクエストには startDate
パラメータと endDate
パラメータを含む dateRange
オブジェクトが含まれます。日付パラメータは YYYY-MM-DD
形式です。これらの値は、サードパーティ サービスへのデータ取得リクエストに使用できます。
- デフォルトでは、指定期間は過去 28 日間(今日を除く)です。
- ユーザーがレポートに期間フィルタを適用している場合、ユーザーの選択が指定期間に反映されます。
- Looker Studio がセマンティック型を検出しようとすると、
getData
リクエストで sampleExtraction
が true
に設定されます。このリクエストの開始日と終了日に指定される日付は、今日より 2 日前になります。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[[["\u003cp\u003eWhen fetching data requiring a date range, leverage Looker Studio's date range features by setting \u003ccode\u003edateRangeRequired\u003c/code\u003e to \u003ccode\u003etrue\u003c/code\u003e in your connector's \u003ccode\u003egetConfig\u003c/code\u003e response.\u003c/p\u003e\n"],["\u003cp\u003eThis enables Looker Studio to include start and end dates with every \u003ccode\u003egetData\u003c/code\u003e request, allowing you to filter data from external sources.\u003c/p\u003e\n"],["\u003cp\u003eThe default date range is the last 28 days excluding today, but users can apply custom ranges, and semantic type detection uses a two-day offset.\u003c/p\u003e\n"]]],[],null,["# Date range control\n\nIf you are working with a data source that requires a date range when fetching\ndata, you can take advantage of the [Looker Studio date range features](https://support.google.com/looker-studio/answer/6291067).\n\nTo enable the date range control feature for your Community Connector, set\n`dateRangeRequired` to `true` in your\n[`getConfig`](/looker-studio/connector/reference#getconfig) response. Then,\nLooker Studio will include a start and end date with every\n[`getData`](/looker-studio/connector/reference#getdata) request made to your\nconnector.\n\n`getData` behavior when `dateRangeRequired` is `true`\n-----------------------------------------------------\n\nWhen `dateRangeRequired` is set to `true` in your `getConfig` response, each\n[`getData`](/looker-studio/connector/reference#getdata) request will contain a\n`dateRange` object with `startDate` and `endDate` parameters. The date\nparameters will be in `YYYY-MM-DD` format. You can use these values in data\nfetch requests to third-party services.\n\n- By default, the date range provided will be the last 28 days, excluding today.\n- If a user applies a date range filter for a report then the date range provided will reflect the user selection.\n- When Looker Studio is attempting to detect [semantic types](/looker-studio/connector/semantics), [`sampleExtraction`](/looker-studio/connector/reference#request_3) is set to `true` in `getData` requests. For these requests, the date provided for the start and the end date is two days earlier than today."]]