Using Ask with Custom Exceptions

Learn how to use the ask keyword to create custom exceptions.

Overview

The ask keyword allows automations to prompt the user with a custom question. These prompts are raised as custom exceptions 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 Email, SMS, and Push Notification.

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 English, Spanish, Hindi, and French.

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

Providing Guidance

When Kognitos raises a custom exception with the ask 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.

4. Compute an Answer

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

Last updated

Was this helpful?