> For the complete documentation index, see [llms.txt](https://docs.kognitos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kognitos.com/legacy/legacy-experience/exception-handling/using-ask-with-custom-exceptions.md).

# Using Ask with Custom Exceptions

## Overview

The [`ask`](https://docs.kognitos.com/legacy/legacy-experience/exception-handling/pages/MTe0OD9wbiIWgu7X2UI1#id-13.-ask-keyword) keyword allows automations to prompt the user with a **custom question**. These prompts are raised as custom [**exceptions**](/legacy/legacy-experience/exception-handling.md) during execution.

## Syntax

Write the keyword **ask** followed by your question in quotation marks. When raising an exception, Kognitos will use this text for the question:

```
ask "Your question here"
```

Optionally, you can provide a set of answer **choices**. Kognitos will display these options in a dropdown menu where the user can select a value for guidance.

```
ask "Your question here"
  the choices are "Option 1", "Option 2", "Option 3", "Option 4" ...
```

## Examples

### **Without Choices**

```
ask "What is the billing code?"
```

```
ask "What is the total amount approved?"
```

```
ask "Who is the hiring manager?"
```

### **Specifying Choices**

#### **Example 1**

In this example, the automation will raise an exception asking **What is the notification method?** and the user will be presented a list of dropdown choices including <kbd>Email</kbd>, <kbd>SMS</kbd>, and <kbd>Push Notification</kbd>.

```undefined
ask "What is the notification method?"
  the choices are "Email", "SMS", "Push Notification"
```

#### Example 2

Here, the automation will raise an exception asking **What is the preferred language?** The user will be presented with a list of dropdown choices that contain <kbd>English</kbd>, <kbd>Spanish</kbd>, <kbd>Hindi</kbd>, and <kbd>French</kbd>.

```
ask "What is the preferred language?"
  the choices are "English", "Spanish", "Hindi", "French"
```

## Providing Guidance

When Kognitos raises a custom exception with the [`ask`](https://docs.kognitos.com/legacy/legacy-experience/exception-handling/pages/MTe0OD9wbiIWgu7X2UI1#id-13.-ask-keyword) keyword, you’ll need to guide the automation by choosing how to respond. The resolution methods depend on whether the exception includes **choices.**

### When Choices Are Provided

In this case, the recommended resolution method is to **Pick a Suggested Value.** This will allow the user to select one of the predefined options from the dropdown list. This is the safest and most reliable way to resolve the exception.

### When Choices Are *Not* Provided

#### **1. Write in an Answer**

Type a value directly into the text box for the requested field.

#### **2. No Value**

Indicate that no value should be used for now. A dash (`-`) will be inserted as a placeholder. This is best used when the information is unavailable or not relevant.

#### **3. Skip this Step**

Bypass the current step entirely.

{% hint style="danger" %}
Be cautious: skipping may cause additional exceptions later if other steps depend on the missing data.
{% endhint %}

#### **4. Compute an Answer**

Modify the automation syntax to avoid this exception. Use the **Mini-Playground** to test changes safely before applying them.


---

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

```
GET https://docs.kognitos.com/legacy/legacy-experience/exception-handling/using-ask-with-custom-exceptions.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.
