> For the complete documentation index, see [llms.txt](https://docs.dashcomb.com/dashcomb-help-center/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dashcomb.com/dashcomb-help-center/ide/query-region/tomshon.md).

# オートメーション

連携機能パネルのオートメーションタブでは、データソースのSQLデータベースにデータをインポートするための設定を作成できます。

Importer コンポーネントと組み合わせて使うことで、ユーザーがアップロードしたCSVファイルやJSONオブジェクトをデータベースにインポートすることができます。

送信先のSQLデータベースは、データソース メニューから登録します。詳しい手順は、[Data Source接続の設定](https://github.com/dashcomb/gitbook-doc/blob/master/ide/query-region/broken-reference/README.md) を参照してください。

<figure><img src="/files/GoBuuuKuJKkldLVDfcdR" alt=""><figcaption></figcaption></figure>

## **オートメーションクエリ一覧**

編集中の管理画面で作成されたオートメーションクエリ名が表示されます。

オートメーションクエリ名をクリックすると、その内容が表示され、編集することができます。

### **キーワードフィルター**

入力したキーワードで、オートメーションクエリを絞り込みできます。

（例）`user` を入力すると、`import_new_users` 、`import_disabled_users` ... などの該当するオートメーションクエリが表示されます。

### オートメーションクエリの操作

操作したいオートメーションクエリにマウスカーソルを載せると、操作アイコンが表示されます。このアイコンをクリックして、各種操作を行うことができます。

#### オートメーションクエリの追加

キーワードフィルターの隣の<img src="/files/nnk5fNFpQzHO78sG54bM" alt="" data-size="line">をクリックすると、オートメーションクエリが追加されます。

#### オートメーションクエリ名の変更

<img src="/files/htponMpbKKTy4U2nYBuX" alt="" data-size="line">をクリックすると、オートメーションクエリの名称を変更できます。

#### オートメーションクエリの削除

<img src="/files/4Gcj3lwAm0jfyFIaV9vy" alt="" data-size="line">をクリックすると、オートメーションクエリが削除されます。

## オートメーションクエリの編集

オートメーションクエリの一覧からクエリ名をクリックすると、内容が表示されます。

### アクション

オートメーションクエリの操作内容を指定します。

### 前処理

#### 実行前アクション

本番処理を実行する前の動作を、以下から選択できます。

<table><thead><tr><th width="198">選択内容</th><th>動作</th></tr></thead><tbody><tr><td>アクション無し</td><td>実行前アクションを設定しません。すぐに本番処理が開始されます。</td></tr><tr><td>確認</td><td>本番処理を実行する前に、ユーザー確認モーダルを表示します。<br>モーダルの「確認」ボタンをクリックすると、本番処理が実行されます。</td></tr><tr><td>承認</td><td>本番処理を実行する前に、責任者に承認を求めることができます。<br>承認要件モーダルの「提出」ボタンをクリックすると、選択されたユーザーに承認依頼が届きます。承認されると、本番処理が実行されます。</td></tr></tbody></table>

承認の設定手順については、[承認フローを作成](/dashcomb-help-center/tips-and-tricks/add-approval-flow.md) を参照してください。

#### JavaScript

前処理として、JavaScript プログラムを実行することができます。

トグルスイッチをONにすると、JavaScript プログラムの入力欄が表示されます。

### 本番処理

SQLデータベースに送信するデータを設定します。

以下の項目を設定します。

<table><thead><tr><th width="198">項目名</th><th>設定内容</th></tr></thead><tbody><tr><td>ソースデータ</td><td>データベースに送信するデータを設定します。<br>importer コンポーネントで受け取ったファイルの内容を指定できます。</td></tr><tr><td>送信先データソース</td><td>データソースで設定したSQLサーバーを選択します。</td></tr><tr><td>送信先テーブル</td><td>データソースのSQLサーバーからテーブル名を選択します。</td></tr></tbody></table>

具体的な設定例は、 [CSV/JSONデータのインポートとダウンロード](/dashcomb-help-center/tips-and-tricks/upload-and-download-cvs.md) を参照してください。

### 後処理

本番処理のオートメーションクエリが送信・実行された後に実行する処理を登録できます。

#### JavaScript

後処理として、JavaScript プログラムを実行することができます。

トグルスイッチをONにすると、JavaScript プログラムの入力欄が表示されます。

本番処理の結果は、`this.data` で利用できます。

後処理のJavaScriptでreturn した内容は、`{{ オートメーションクエリ名.data }}` で参照できるようになります。

#### 成功時

オートメーションクエリの処理が成功した場合のアクションを設定できます。

<img src="/files/htponMpbKKTy4U2nYBuX" alt="" data-size="line">をクリックすると、アクションエディタが開きます。

#### 失敗時

オートメーションクエリの処理が失敗した場合のアクションを設定できます。

<img src="/files/htponMpbKKTy4U2nYBuX" alt="" data-size="line">をクリックすると、アクションエディタが開きます。

{% hint style="info" %}
アクションの設定については、[アクションエディタ](/dashcomb-help-center/ide/property-region/action-editor.md) を参照してください。
{% endhint %}

### 実行

パネル右上の「実行」ボタンをクリックすると、オートメーションクエリが実行され、パネルの最下部に結果が表示されます。

### 保存

パネル右上の「保存」ボタンをクリックすると、オートメーションクエリが保存されます。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.dashcomb.com/dashcomb-help-center/ide/query-region/tomshon.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
