2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GoogleWorkspaceStudioを使って共用スプレッドシートに結果を残す

Last updated at Posted at 2026-01-14

はじめに

Google Workspace Studio(Gemini等)、便利ですよね?ただ、社内の案件で「大量のpdfからチェック項目を抽出(Extract)する」作業を自動化を自動化しようとした際、動作が落ちてしまう現象に遭遇しました。

またこの記事は2026年1月時点での情報で、Workspace Studioの機能や権限管理のやり方もどんどん修正されている印象もあるので、将来的には変わるかもしれません。

発生したエラー

Workspace Studioで「シートに記載する」アクションを実行した際、以下のエラーメッセージが表示されました。

Couldn't update the file because it's shared with others. Select a file that only you can access. 

実は公式ドキュメント(Troubleshoot issues with flowsGuide to Starters & Steps in Workspace Studio)にも記載があります。といってもエラー内容の解説そのままなんですが。

You might see this error for one of the following reasons:

  • The file you selected is shared with other people or groups.
  • The file was private when you created the flow, but has since been shared.

どうやらWorkspace Studioでは他のユーザーと共有したスプレッドシートが利用できないようです。以前(年末)はできたような記憶があるので、Google側も権限管理について苦慮してるのかもしれません。

暫定的な回避策

暫定対処として、Workspace Studioで書き込みされた際に、GASで更に共有用シートに転記するようにしました。また、単に IMPORTRANGE 関数を使用して参照させようともしたのですが、Google側からは共有されていると見なされ、同様のエラーが発生しました。

以下のようなスクリプトを作業用シート側に仕込み、Workspace Studioの処理が終わったタイミングで実行します。

function copyValuesBetweenSpreadsheets() {
  // 1. スプレッドシートのIDを指定
  const srcSsId = '書き込み元のスプレッドシートのID';
  const dstSsId = '書き込み先のスプレッドシートのID';

  // 2. シート名を指定
  const srcSheetName = 'シート1';
  const dstSheetName = 'シート1';

  // 3. スプレッドシートとシートを取得
  const srcSheet = SpreadsheetApp.openById(srcSsId).getSheetByName(srcSheetName);
  const dstSheet = SpreadsheetApp.openById(dstSsId).getSheetByName(dstSheetName);

  // 4. コピー元の全データを取得
  const data = srcSheet.getDataRange().getValues();

  // 5. コピー先のデータをクリアして貼り付け
  dstSheet.clearContents(); // 前のデータを消したい場合
  dstSheet.getRange(1, 1, data.length, data[0].length).setValues(data);
}

そして次のようなトリガーを設定します。

スクリーンショット 2026-01-14 20.02.23.png

まとめ

社内ツールとして展開する必要がある場合、この「二段構え」の構成が今のところの現実解になりそうです。もっとスマートな方法がないかも考えてみます。

また、Troubleshoot issues with flowsを見ると他のユーザーとDiscordで議論できるようなので困った際にはここに相談すると良さそうです。

Join the Workspace Studio Discord channel, a dedicated space to connect, hold discussions, and network.

  1. Join the public Google Workspace server.
  2. On the left, find the #workspace-studio channel.
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?