# Бот с каталогом в кнопках

Для первого блока HTTP

```javascript
for (i = 1; i <= 100; i++) {
 deleteContactVariable("Кнопка "+i);
};
```

Для второго блока HTTP

```javascript
var total = response.data.meta.total;

for (i = 1; i <= total; i++) {
 var tovar = response.data.data[i-1].nazvanie;
 var cena = response.data.data[i-1].cena;
 setContactVariable("Кнопка "+i,
 tovar+" | "+cena+" ₽");
};
```

Для третьего блока HTTP

```javascript
var vibor = getContactVariable("выбор");
vibor = vibor.split(" |")[0];
setContactVariable("выбор", vibor);
```


---

# 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://help.watbot.ru/chat-boty/java-script-resheniya/bot-s-katalogom-v-knopkakh.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.
