{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Google Sheets Export Integration","description":"Treasure AIからGoogle Sheetsへのデータエクスポート方法を解説。最大200万セルまでのジョブ結果を簡単に転送し、ビジネスインサイトを分析できます。","siteUrl":"https://docs.treasure.ai","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]},"llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"google-sheets-export-integration","__idx":0},"children":["Google Sheets Export Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure DataからGoogle Sheetsに直接ジョブ結果をエクスポートできます。Google Sheetsでデータをさらに分析し、重要なビジネスインサイトを発見できます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["作成または変換したスプレッドシートに対して、最大200万セルまで転送できます。詳細は",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://support.google.com/drive/answer/37603?hl=en"},"children":["Google Help"]},"をご覧ください。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Google Sheetsにジョブ結果をエクスポートするサンプルワークフローについては、Treasure Boxesをご覧ください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"前提条件","__idx":1},"children":["前提条件"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://toolbelt.treasuredata.com/"},"children":["TD Toolbelt"]},"を含むTreasure Dataの基本知識"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Googleアカウント（Google Drive用）"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["認可されたTreasure アカウントアクセス"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"spreadsheet-keyの取得","__idx":2},"children":["Spreadsheet Keyの取得"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下のようにアクセスURLからspreadsheet keyを取得できます:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191009-211849.8281ddd6d0505b3314ac2952a3cacda53368e56e6f59b21131295124b97a1349.26c56f91.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"folder-keyの取得","__idx":3},"children":["Folder Keyの取得"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下のようにアクセスURLからGoogle DriveのFolder Keyを取得できます:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191009-211909.43939ecdd993a1cf7b9c8f3b011f5b9253f7a5aa9fdac8c4732ef3841f45b532.26c56f91.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"要件","__idx":4},"children":["要件"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"既存の認証の移行","__idx":5},"children":["既存の認証の移行"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Google Sheet V3の2020年3月の非推奨化により、既存のすべての認証を更新する必要があります。2020年2月中旬までに既存の認証の更新を実行する必要があります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["アップグレードには、既存のGoogle Sheet認証にFolder Keyを適用する必要があります。Folder Keyオプションを使用するには、Googleアカウントで「View metadata for files in your Google Drive」権限を選択してください。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Folder Keyオプションで既存の認証を更新しない場合、予測不可能な動作が発生します。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treasure コンソールで、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Integrations Hub"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authentications"]},"に移動します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Google Sheet Authenticationオブジェクトを見つけます。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Click here to connect a new account"]},"を選択して、Googleでの認証にリダイレクトします。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Googleで適切なアカウントを選択し、「View metadata for files in your Google Drive」スコープを含めて",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Allow"]},"を選択します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treasure コンソールで、Google Sheet Authenticationを再度開き、ドロップダウンリストの一番下にある最新の認証アカウントを選択します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Continue"]},"と",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Done"]},"を選択して認証を保存します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["認証を使用して結果をエクスポートするクエリを保存している場合、既存の結果エクスポート設定を削除し、認証を使用した新しいクエリを作成する必要があります。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["同じGoogleアカウントを使用する他の認証で、手順4〜6を繰り返します。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["認証に権限が含まれているかどうかを確認するには、Googleアカウントにログインし、ブラウザでURL: ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://myaccount.google.com/permissions"},"children":["https://myaccount.google.com/permissions"]},"にアクセスしてください。以下のようにGoogle DriveでのTreasure Data権限を確認します:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/google-sheets-export-integration-2024-01-24.8e472dfb5acdaafe5a7931f0a4acc63451ee3e6c300929fef34daa1b7c9f295b.26c56f91.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"treasure-data-integration-の静的-ip-アドレス","__idx":6},"children":["Treasure Data Integration の静的 IP アドレス"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["セキュリティポリシーで IP ホワイトリストが必要な場合は、接続を成功させるために Treasure Data の IP アドレスを許可リストに追加する必要があります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["リージョンごとに整理された静的 IP アドレスの完全なリストは、次のリンクにあります:"," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/endpoints/ip-addresses-integrations-result-workers"},"children":["IP Addresses for Integrations"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"treasure-コンソールを使用した接続の作成","__idx":7},"children":["Treasure コンソールを使用した接続の作成"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"新しい接続の作成","__idx":8},"children":["新しい接続の作成"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["クエリを実行する前に、エクスポートデータ接続を作成して設定する必要があります。データ接続の一部として、統合にアクセスするための認証を提供します。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Integrations Hub"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Catalog"]},"に移動します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Google Sheetsを検索して選択します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191016-211606.08a0941c9380afef437097f8793d94e6eaac4dce47067e827895ab7f0f9e95b6.26c56f91.png","alt":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["認証ダイアログが開きます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["既存のOAuth接続を選択するか、新しい接続を作成して接続を認証します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2022-6-29_0-46-30.31d3d6d8e156ca02345d5741fc49f66a759f7453ee3fd0924db2146a7b2ee16f.26c56f91.png","alt":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["新しいGoogle Sheets接続の名前を選択します。"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"アカウントの認証","__idx":9},"children":["アカウントの認証"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Data Google Sheets統合へのアクセスには、OAuth2認証が必要です。認証では、Treasure アカウントをそれぞれのGoogleアカウントに接続する必要があります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["既存の接続がない場合は、新しい認証を作成します。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["認証ダイアログを開いた後、「OAuth connection」の下にあるリンクを選択して新しい接続を作成します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ポップアップウィンドウでGoogle Sheetsアカウントにログインし、Treasure Dataアプリへのアクセスを許可します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"https://confluence-20211204-258573741.us-west-2.elb.amazonaws.com/download/attachments/328295/image-20191016-211626.png?version=1&modificationDate=1571260587564&api=v2","alt":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["統合ダイアログペインにリダイレクトされます。Google Sheetsを選択し、ドロップダウンメニューから新しい接続を選択します。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191016-211634.d9cf8b57211e91b61fc2b4ae9bc866be8b85254782d4aade26a4e3d0219a0498.26c56f91.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"クエリの定義","__idx":10},"children":["クエリの定義"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Data Workbench > Queriesに移動します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New Query"]},"を選択します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["クエリを実行して結果セットを検証します。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-9-7_15-1-38.a0ef34a3cfb6035eb6a53a758a755062decbb29fac046d1b24440a76d0662c7a.26c56f91.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"データ接続でのエクスポート結果の設定","__idx":11},"children":["データ接続でのエクスポート結果の設定"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Workbench"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Queries"]},"に移動します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["既存のクエリを選択するか、新しいクエリを作成します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["クエリエディタで、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Export Results"]},"チェックボックスを選択します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191016-211654.c01ebf114bc73d11d17c870994e5e9a16952645c80d4f307b2f2ab2eefded596.26c56f91.png","alt":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Google Sheet接続を選択します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Export Resultsダイアログペインが開きます。以下のパラメータを編集します。"]}]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameters"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Parameters"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["spreadsheet_id"]}]},"または",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["spreadsheet_title"]},"のいずれかを指定する必要があります。両方を使用することはできません。"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Use Spreadsheet Key"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["チェックを外すと、spreadsheet_titleがキーとして使用されます。それ以外の場合は、spreadsheet_idが使用されます。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Spreadsheet name"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["新しいスプレッドシートのタイトル。同じタイトル(大文字小文字を区別)のスプレッドシートが宛先フォルダ(Folder Keyで指定)または任意のフォルダ(FolderKeyが空の場合)に複数存在する場合、ジョブは失敗します。この場合は、代わりにspreadsheet keyで指定してください。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Folder key"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["エクスポートするデータのフォルダID。空の場合、宛先フォルダはスプレッドシート名の一致によって決定されるか、一致しない場合は",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["My Drive"]},"のルートフォルダが使用されます。このパラメータはスプレッドシート名を使用する場合にのみ利用可能です。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Worksheet"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["スプレッドシート内のワークシートの名前。この名前は(スペースを含めて)Googleワークシート名と比較されます。空の場合、データは最初のワークシートにエクスポートされます。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Upload mode"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["スプレッドシート内のデータを変更するモード。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Range"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["データが書き込まれる初期セル位置。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Batch rows to upload"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1回の呼び出しでスプレッドシートにアップロードする行数。バッチアップロードの行数が多いほど、アップロードされるペイロードボリュームが大きくなり、すべてのデータのアップロードを完了するために必要な呼び出し回数が少なくなります。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Value Input Option"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["RAWを使用してデータをスプレッドシートに直接アップロードするか、USER_ENTEREDを使用します。USER_ENTEREDは、ユーザーがユーザーインターフェースに入力したかのようにデータを解析します。数値は数値のままですが、文字列はGoogle Sheet UIを介してセルにテキストを入力する際に適用されるのと同じルールに従って、数値や日付などに変換される可能性があります。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Set Cell to Null"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["無効な値(0で除算するなど)が検出された場合のセルの表示値を制御します。"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"統合を使用したactivationの作成","__idx":12},"children":["統合を使用したActivationの作成"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["セグメントデータまたはステージをエクスポートするためのactivationを作成できます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Product DocumentationポータルでActivationを作成する手順を確認してください:",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/create-an-activation"},"children":["Creating an Activation"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"クエリの例","__idx":13},"children":["クエリの例"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"SELECT * FROM www_access\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"データの変更","__idx":14},"children":["データの変更"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["次の方法でスプレッドシートデータを操作できます:Replace、Append、Truncate、Update。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"replace","__idx":15},"children":["Replace"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["テーブルが既に存在する場合、既存のテーブルの行はクエリ結果で置き換えられます。テーブルが存在しない場合は、新しいテーブルが作成されます。これがデフォルトのモードです。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"append","__idx":16},"children":["Append"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["クエリ結果はスプレッドシートの末尾に追加されます。テーブルがまだ存在しない場合は、新しいテーブルが作成されます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例えば、1000行の空の行があるデフォルトのシートがある場合、APPENDモードはスプレッドシートで表示される最後の行の次の行(この例では1001行目)からクエリ結果の行を追加し始めます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"truncate","__idx":17},"children":["Truncate"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["テーブルがすでに存在する場合、既存の行がクリアされ、クエリ結果がテーブル内で更新されます。テーブルがまだ存在しない場合は、新しいテーブルが作成されます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下は、truncateモードを実行する前のテーブル値の例です。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191016-211740.0906f21c4359278384d8cda93e0e9747d644e82b7fd25825dd04f9584562f87b.26c56f91.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下は、truncateモードを実行した後、idカラムにクエリ結果が入ったテーブル値の例です。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191016-211746.e6348078d15d6339a80744b2460e70cc8cbbf2e5480e8780788c22b58d07514f.26c56f91.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"update","__idx":18},"children":["Update"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["テーブルがすでに存在する場合、既存の行がクエリ結果によってテーブル内で更新されます。テーブルがまだ存在しない場合は、新しいテーブルが作成されます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下は、updateモードを実行する前のテーブル値の例です。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191016-211755.a2acbd4579cca5af43883e8425c737e97e1bb444fd1ae8ec61ece83c0e53a30e.26c56f91.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下は、updateモードを実行した後のテーブル値の例です。範囲A1から、カラムが更新されます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image-20191016-211804.4f50d580800a8345f767b22e30a009f76c57de8b786858fa114bb381385889e9.26c56f91.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"オプション-query-export-ジョブをスケジュールする","__idx":19},"children":["(オプション) Query Export ジョブをスケジュールする"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Scheduled Jobs と Result Export を使用して、指定したターゲット宛先に出力結果を定期的に書き込むことができます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Data のスケジューラー機能は、高可用性を実現するために定期的なクエリ実行をサポートしています。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["2 つの仕様が競合するスケジュール仕様を提供する場合、より頻繁に実行するよう要求する仕様が優先され、もう一方のスケジュール仕様は無視されます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例えば、cron スケジュールが ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'0 0 1 * 1'"]}," の場合、「月の日」の仕様と「週の曜日」が矛盾します。前者の仕様は毎月 1 日の午前 0 時 (00:00) に実行することを要求し、後者の仕様は毎週月曜日の午前 0 時 (00:00) に実行することを要求するためです。後者の仕様が優先されます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"treasure-コンソール-を使用してジョブをスケジュールする","__idx":20},"children":["Treasure コンソール を使用してジョブをスケジュールする"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Workbench > Queries"]}," に移動します"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["新しいクエリを作成するか、既存のクエリを選択します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Schedule"]}," の横にある None を選択します。"," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-1-15_17-28-51.f1b242f6ecc7666a0097fdf37edd1682786ec11ef80eff68c66f091bc405c371.0f87d8d4.png","alt":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ドロップダウンで、次のスケジュールオプションのいずれかを選択します:"," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-1-15_17-29-47.45289a1c99256f125f4d887e501e204ed61f02223fde0927af5f425a89ace0c0.0f87d8d4.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"ドロップダウン値"},"children":["ドロップダウン値"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"説明"},"children":["説明"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom cron..."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#custom-cron-details"},"children":["Custom cron... の詳細"]},"を参照してください。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["@daily (midnight)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["指定されたタイムゾーンで 1 日 1 回午前 0 時 (00:00 am) に実行します。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["@hourly (:00)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["毎時 00 分に実行します。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["None"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["スケジュールなし。"]}]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"custom-cron-の詳細","__idx":21},"children":["Custom cron... の詳細"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-1-15_17-30-23.0f94a8aa5f75ea03e3fec0c25b0640cd59ee48d1804a83701e5f2372deae466c.0f87d8d4.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Cron 値"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Cron 値"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"説明"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["説明"]}]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0 * * * *"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1 時間に 1 回実行します。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0 0 * * *"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1 日 1 回午前 0 時に実行します。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0 0 1 * *"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["毎月 1 日の午前 0 時に 1 回実行します。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\"\""]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["スケジュールされた実行時刻のないジョブを作成します。"]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":" *    *    *    *    *\n -    -    -    -    -\n |    |    |    |    |\n |    |    |    |    +----- day of week (0 - 6) (Sunday=0)\n |    |    |    +---------- month (1 - 12)\n |    |    +--------------- day of month (1 - 31)\n |    +-------------------- hour (0 - 23)\n +------------------------- min (0 - 59)\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["次の名前付きエントリを使用できます:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Day of Week: sun, mon, tue, wed, thu, fri, sat."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["各フィールド間には単一のスペースが必要です。各フィールドの値は、次のもので構成できます:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"fixed-table"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"35%","data-label":"フィールド値"},"children":["フィールド値 "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"20%","data-label":"例"},"children":["例 "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"45%","data-label":"例の説明"},"children":["例の説明 "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["各フィールドに対して上記で表示された制限内の単一の値。"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["フィールドに基づく制限がないことを示すワイルドカード"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'*'"]},"。"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'0 0 1 * *'"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["毎月 1 日の午前 0 時 (00:00) に実行するようにスケジュールを設定します。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["範囲 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'2-5'"]}," ","フィールドの許可される値の範囲を示します。"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'0 0 1-10 * *'"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["毎月 1 日から 10 日までの午前 0 時 (00:00) に実行するようにスケジュールを設定します。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["カンマ区切りの値のリスト ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'2,3,4,5'"]}," ","フィールドの許可される値のリストを示します。"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0 0 1,11,21 * *'"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["毎月 1 日、11 日、21 日の午前 0 時 (00:00) に実行するようにスケジュールを設定します。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["周期性インジケータ ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'*/5'"]}," ","フィールドの有効な値の範囲に基づいて、"," ","スケジュールが実行を許可される頻度を表現します。"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'30 */2 1 * *'"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["毎月 1 日、00:30 から 2 時間ごとに実行するようにスケジュールを設定します。"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'0 0 */5 * *'"]}," は、毎月 5 日から 5 日ごとに午前 0 時 (00:00) に実行するようにスケジュールを設定します。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'*'"]}," ","ワイルドカードを除く上記の"," ","いずれかのカンマ区切りリストもサポートされています"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'2,*/5,8-10'"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["'0 0 5,*/10,25 * *'"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["毎月 5 日、10 日、20 日、25 日の午前 0 時 (00:00) に実行するようにスケジュールを設定します。"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["(オプション) Delay execution を有効にすることで、クエリの開始時刻を遅延させることができます。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"クエリを実行する","__idx":22},"children":["クエリを実行する"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["クエリに名前を付けて保存して実行するか、単にクエリを実行します。クエリが正常に完了すると、クエリ結果は指定された宛先に自動的にエクスポートされます。"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["設定エラーにより継続的に失敗するスケジュールジョブは、複数回通知された後、システム側で無効化される場合があります。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["(オプション) Delay execution を有効にすることで、クエリの開始時刻を遅延させることができます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"オプション-workflowでのエクスポート結果の設定","__idx":23},"children":["(オプション) Workflowでのエクスポート結果の設定"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure ワークフロー内で、このデータコネクタを使用してデータを出力するように指定できます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["使用可能なパラメータは次のとおりです。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["spreadsheet_id"]},": String。Spreadsheetキー。必須。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["spreadsheet_title"]},": String。Spreadsheet名。必須。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["spreadsheet_folder"]},": String。デフォルトはnull。フォルダID。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sheet_title"]},": String。デフォルトはnull。Worksheet名。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["mode"]},": String(append|replace|truncate|update)。デフォルトはappend。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["range"]},": String。デフォルトはA1で、シートの左上隅。rangeはAPPENDモードでは効果がありません。これは、新しい行が最後の行の後に追加されるためです。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["rows_threshold"]},": Integer。デフォルトは50000、最大は2000000。Google APIは各リクエストペイロードに対して10MBの閾値があります。このデータコネクタは、どちらの閾値に先に到達するかを自動的に検出します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["value_input_option"]},": String",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["(RAW, USER_ENTERED)"]},"。デフォルトはRAW。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["set_nil_for_double_nan"]},": デフォルトはtrue。例えば、NaNを空文字列に変換します。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["spreadsheet_id"]},"または",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["spreadsheet_title"]},"を選択してください。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"timezone: UTC\n\n_export:\n  td:\n    database: sample_datasets\n\n+td-result-into-target:\n  td>: queries/sample.sql\n  result_connection: my_googlesheet_connector\n  result_settings:\n    spreadsheet_title: value1\n    mode: replace\n    ....\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"オプション-cliを使用したエクスポート統合","__idx":24},"children":["(オプション) CLIを使用したエクスポート統合"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure ワークフロー内で、このデータコネクタを使用してデータをエクスポートするように指定できます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["詳細については、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/exporting-data-with-parameters"},"children":["Exporting Data with Parameters"]},"を参照してください。"]}]},"headings":[{"value":"Google Sheets Export Integration","id":"google-sheets-export-integration","depth":1},{"value":"前提条件","id":"前提条件","depth":2},{"value":"Spreadsheet Keyの取得","id":"spreadsheet-keyの取得","depth":2},{"value":"Folder Keyの取得","id":"folder-keyの取得","depth":2},{"value":"要件","id":"要件","depth":2},{"value":"既存の認証の移行","id":"既存の認証の移行","depth":3},{"value":"Treasure Data Integration の静的 IP アドレス","id":"treasure-data-integration-の静的-ip-アドレス","depth":2},{"value":"Treasure コンソールを使用した接続の作成","id":"treasure-コンソールを使用した接続の作成","depth":2},{"value":"新しい接続の作成","id":"新しい接続の作成","depth":3},{"value":"アカウントの認証","id":"アカウントの認証","depth":3},{"value":"クエリの定義","id":"クエリの定義","depth":3},{"value":"データ接続でのエクスポート結果の設定","id":"データ接続でのエクスポート結果の設定","depth":3},{"value":"統合を使用したActivationの作成","id":"統合を使用したactivationの作成","depth":3},{"value":"クエリの例","id":"クエリの例","depth":3},{"value":"データの変更","id":"データの変更","depth":3},{"value":"Replace","id":"replace","depth":4},{"value":"Append","id":"append","depth":4},{"value":"Truncate","id":"truncate","depth":4},{"value":"Update","id":"update","depth":4},{"value":"(オプション) Query Export ジョブをスケジュールする","id":"オプション-query-export-ジョブをスケジュールする","depth":3},{"value":"Treasure コンソール を使用してジョブをスケジュールする","id":"treasure-コンソール-を使用してジョブをスケジュールする","depth":4},{"value":"Custom cron... の詳細","id":"custom-cron-の詳細","depth":4},{"value":"クエリを実行する","id":"クエリを実行する","depth":3},{"value":"(オプション) Workflowでのエクスポート結果の設定","id":"オプション-workflowでのエクスポート結果の設定","depth":2},{"value":"(オプション) CLIを使用したエクスポート統合","id":"オプション-cliを使用したエクスポート統合","depth":1}],"frontmatter":{"seo":{"title":"Google Sheets Export Integration","description":"Treasure AIからGoogle Sheetsへのデータエクスポート方法を解説。最大200万セルまでのジョブ結果を簡単に転送し、ビジネスインサイトを分析できます。"}},"lastModified":"2026-06-17T07:22:53.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/int/google-sheets-export-integration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}