# Using Ask with Custom Exceptions

## Overview

The [`ask`](https://docs.kognitos.com/legacy/writing-automations/automation-basics/keywords#id-13.-ask-keyword) keyword allows automations to prompt the user with a **custom question**. These prompts are raised as custom [**exceptions**](https://docs.kognitos.com/legacy/legacy-experience/exception-handling) 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/writing-automations/automation-basics/keywords#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.
