> 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/javascript.md).

# JavaScript

連携機能パネルのJavaScriptタブから、JavaScriptの処理を登録できます。

標準で提供されているアクションでは対応できない複雑な動作を実現するために活用できます。

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

## **JavaScript処理一覧**

編集中の管理画面で作成されたJavaScpript の処理名が表示されます。

名称をクリックすると、その内容が表示され、編集することができます。

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

入力したキーワードで、JavaScpript の処理を絞り込みできます。

### JavaScript処理の操作

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

#### JavaScript処理の追加

キーワードフィルターの隣の<img src="/files/nnk5fNFpQzHO78sG54bM" alt="" data-size="line">をクリックすると、JavaScript処理が追加されます。

#### JavaScript処理の変更

<img src="/files/htponMpbKKTy4U2nYBuX" alt="" data-size="line">をクリックすると、JavaScript処理の名称を変更できます。

#### JavaScript処理の削除

<img src="/files/4Gcj3lwAm0jfyFIaV9vy" alt="" data-size="line">をクリックすると、JavaScript処理が削除されます。

## JavaScript処理の編集

JavaScript処理の一覧から名称をクリックすると、内容が表示されます。

### 前処理

本番処理を実行する前に実行される処理を登録できます。

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

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

<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></tbody></table>

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

### 本番処理

実行するJavaScriptプログラムを入力します。

ここでreturn した内容は、 `{{ JavaScript処理名.data }}` で参照できるようになります。

### 後処理

本番処理が実行された後に実行する処理を登録できます。

#### 成功時

JavaScript の処理が成功した場合のアクションを設定できます。

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

#### 失敗時

JavaScript の処理が失敗した場合のアクションを設定できます。

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

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

### 実行

パネル右上の「実行」ボタンをクリックすると、JavaScript 処理が実行され、パネルの最下部に結果が表示されます。

### 保存

パネル右上の「保存」ボタンをクリックすると、JavaScript 処理が保存されます。


---

# 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/javascript.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.
