# 変数の値を設定ノード

変数の値を更新したい場合（例：顧客情報や認証コードを更新する場合）、**「変数の値を設定」ノード**を使用すると効率的に設定可能です。\
このノードを利用することで、変数に保存した内容へ文字列の追記や他の変数・数式を用いた更新が可能です。

### 基本操作手順　 <a href="#operating-procedure" id="operating-procedure"></a>

※画像は、元の顧客コードに対して、数式を用いてコード内容を更新する例です

<figure><img src="https://i0.wp.com/guide.allganize.ai/wp-content/uploads/2022/01/image-41-3.png?resize=570%2C464&#x26;ssl=1" alt=""><figcaption></figcaption></figure>

1. ノードバー内のアイコンをクリックし、**「変数の値を設定ノード」**&#x3092;追加します。

   追加すると、フローチャート上にノードが表示されます。

<figure><img src="https://3244404108-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR2CRA2CisD1pVQUgqd1g%2Fuploads%2FhOHWJ1YNhG6nalPC7kMR%2F%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202024-10-15%2016.30.01.png?alt=media&#x26;token=78db33a0-61ae-4bc5-b544-fa0ff5a8a496" alt=""><figcaption></figcaption></figure>

2. ノードエディタを開き、**「変数を追加」**&#x3092;クリックし、更新対象の変数を選択します。
3. 入力欄で、次のいずれかの形式を選択します。

   * **値**\
     文字列や数値などの固定値を直接入力して保存する。
   * **変数**\
     他の変数を指定して保存する。
   * **数式**\
     変数値に数式や関数などの計算式を指定して保存する

   \
   「変数」の形式と「数式」の形式の詳細については、次のガイドを参照してください。

   * [**変数の値を設定ノードで変数を使用する**](https://docs.allganize.ai/alli-llm-app-market/project-settings/variables/set-variable-values)
   * [**変数の値を設定ノードで計算式を使用する**](https://docs.allganize.ai/alli-llm-app-market/app-management/advanced-flow-example/assign-value-node-general-operations)
4. 割り当てられる数式に更新内容を記入します。

<figure><img src="https://3244404108-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR2CRA2CisD1pVQUgqd1g%2Fuploads%2Fe7QOWnRSZ9wZRMpCU8RC%2F%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202024-10-30%2015.16.42.png?alt=media&#x26;token=01d8dbf2-1721-49d5-8430-073d7f07e1c5" alt=""><figcaption></figcaption></figure>

5. 最後に\[更新]ボタンをクリックして変更を保存します。

注：既存の変数の値が指定されている場合とない場合がありますが、これに関係なく、ノードが実行されると、ノードの指定された変数の値が更新されます。

### 活用例：入力フォームと組み合わせて回答生成を行う際のプロンプトを成型する

本活用例では、回答生成を行う際、ユーザーからの入力は入力フォームで受け取り、具体的な指示は「変数の値を設定ノード」でプロンプトに組み込みます。これにより、ユーザーが直接入力する負担を最小限に抑えながら、質問文を成型して回答を生成できます。

<figure><img src="https://3244404108-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR2CRA2CisD1pVQUgqd1g%2Fuploads%2FQX3FFNqTXP4tRWP1mq1r%2Fimage.png?alt=media&#x26;token=11026b4c-7499-4a0a-bdb7-30731345eb06" alt=""><figcaption></figcaption></figure>

1. **「入力フォームノード」の設定**\
   ユーザーに提示するメッセージ、入力項目のラベル、保存先の変数を設定\
   ※設定方法の詳細は[入力フォーム](https://docs.allganize.ai/alli-llm-app-market/app-management/node/build-a-form-node)をご参照ください

<figure><img src="https://3244404108-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR2CRA2CisD1pVQUgqd1g%2Fuploads%2FsvBgesqaZE7fHkz8kwE0%2Fimage.png?alt=media&#x26;token=634a00ef-22ab-4d74-9dab-d980629f57b9" alt="" width="563"><figcaption></figcaption></figure>

2. **「変数値の設定ノード」の設定**\
   ・変数：保存したい変数名を選択（例：@QUERY）\
   ・形式：「値」を選択\
   ・割り当てられる値：入力フォームで用いた変数名（例：@INDUSTRY,@COMPANY\_NAME）を代入したプロンプトを記入

<figure><img src="https://3244404108-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR2CRA2CisD1pVQUgqd1g%2Fuploads%2FzuGmrZCfALvCCRJPBpMb%2Fimage.png?alt=media&#x26;token=9eca37d3-550f-4568-bd85-5a1d8c532a55" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://3244404108-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR2CRA2CisD1pVQUgqd1g%2Fuploads%2FOLSJbKFBlA8O4lAyTLUa%2Fimage.png?alt=media&#x26;token=3ed3c72e-f05a-4a11-814d-1b1dfc65b7d9" alt="" width="376"><figcaption></figcaption></figure>

3. **「回答生成ノード」の設定**\
   ・質問の入力方式：変数を選択\
   ・質問変数：「変数値の設定ノード」で選択した変数を設定（例：@QUERY）\
   ・その他項目は用途に応じて設定　※設定方法の詳細は[回答生成ノード](https://docs.allganize.ai/alli-llm-app-market/app-management/node/generative-answer)をご参照ください

<figure><img src="https://3244404108-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR2CRA2CisD1pVQUgqd1g%2Fuploads%2FLECwoohnw2Div1EbrNvZ%2Fimage.png?alt=media&#x26;token=f83041d7-5c66-4940-a7fd-580866717949" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://docs.allganize.ai/alli-llm-app-market/app-management/node/assign-value-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
