# 버튼 파라미터 설정

***

## 1. 버튼 파라미터 시나리오의 활용

{% hint style="success" %} <mark style="color:green;">**사용자의 메시지를 수집하는 방법**</mark>에는 \
고객에게 직접 응답을 요구하는 방법과 <mark style="color:green;">**버튼 파라미터를 통해 값을 저장하는 방법**</mark>이 있습니다.
{% endhint %}

{% hint style="info" %} <mark style="color:blue;">**봇 변수(파라미터)란?**</mark>

파라미터(매개변수)의 사전적 의미는 메소드 수행에 필요한 입력 값을 저장하는 변수를 의미하며, 파라미터는 특정 메소드를 호출할 때 같이 끼워 보내는 데이터입니다.
{% endhint %}

***

## 2. 기본  시나리오 만들어보기

#### **👉 따라 해 보세요!**

> \[채팅 상담] 버튼을 클릭하면 고객이 문의 유형을 선택하고, \
> 선택한 값을 보여준 다음 상담 연결로 넘어가는 아래와 같은 시나리오를 완성하는 방법입니다.

<figure><img src="/files/9KmrqzSRyB1O6tlSMCvq" alt=""><figcaption></figcaption></figure>

### 1) 상품, 문의 유형, 연결 블럭 만들기

> 위 시나리오 블럭과 같은 형태의 블럭을 생성하고 블럭을 연결합니다.

### 2) 시나리오에 사용할 변수 생성하기

> 시나리오 좌측 상단에 위치한 \[변수 설정] 버튼을 클릭하여 <mark style="color:orange;">**버튼 파라미터 변수**</mark>를 추가합니다. \
> 여기서는 버튼을 통해서 문의유형을 선택할 것이기 때문에 <mark style="color:orange;">**type(문의유형)**</mark> 변수를 생상합니다.

<figure><img src="/files/5OYr8WdKkF72bLfvsrPk" alt=""><figcaption></figcaption></figure>

<div align="left"><figure><img src="/files/EQB8a6qY8aMEfnkgD5KH" alt="" width="375"><figcaption></figcaption></figure></div>

### 3) 버튼 설정- 변수 연결

> <mark style="color:orange;">**\[문의 유형]**</mark> 블럭의 \[버튼 설정]에서 버튼명, 버튼 기능, 버튼 파라미터를 입력합니다. \
> 각 버튼마다 버튼 파라미터에서 변수를 type(문의유형)으로 설정하고, 변수 값을 입력해줍니다.&#x20;
>
> \
> &#x20;<mark style="color:orange;">\* 고객이 '상품 문의' 버튼을 클릭하면,</mark> \
> &#x20;   <mark style="color:orange;">type(문의유형) 변수에 '상품 문의' 값을 저장하겠다는 의미입니다.</mark>

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

### 4) 채팅화면 확인

> 고객이 선택한 값 변수에 잘 저장된 것을 확인할 수 있습니다.

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

***

## 3. 응용 - 심리 테스트 챗봇&#x20;

{% hint style="success" %}
버튼 파라미터를 응용하면 심리 테스트 챗봇을 쉽게 만들 수 있습니다.
{% endhint %}

<figure><img src="/files/2eSYcKMXxvs3AaiIckfT" alt=""><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://happytalk.gitbook.io/happybot/block_scenario/parameter/button.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.
