Skip to main content
Skip table of contents

Validations Tab

Introduction

In Validations tab, you can choose the way the data provided by the caller is validated against preset rules. You can add multiple validations and prioritize them accordingly or you can use your own custom validation by providing a URL and a token.

Custom validation overrides any other validation.

If multiple validations are set, with different prompts, only the prompts of the last validation will be used if validation fails.

Validation in minApps

Validation is available for the below miniApps.

Alpha miniApps

In Alpha miniApps, you have the following options:

  • Min Length: Set the minimum number of characters

  • Max Length: Set the maximum number of characters

  • Regex: Set the regex pattern

  • Javascript: Provide JS code that will return a boolean value (true/false) that indicates if it passes the validation

  • In list: Set a preset list of accepted string values

You can use any combination of these options in a single validation.

Alphanumeric miniApps

In Alphanumeric miniApps, you have the following options:

  • Min Length: Set the minimum number of characters

  • Max Length: Set the maximum number of characters

  • Regex: Set the regex pattern

  • Javascript: Provide JS code that will return a boolean value (true/false) that indicates if it passes the validation

  • In list: Set a preset list of accepted string values

  • Prebuilt: Use either the US zip code, or the CA zip code prebuilt list

You can use any combination of these options in a single validation.

Amount miniApps

In Amount miniApps, you have the following options:

  • Min Value: Set the minimum number of characters

  • Max Value: Set the maximum number of characters

  • Javascript: Provide JS code that will return a boolean value (true/false) that indicates if it passes the validation

  • Amount Unit: Set the unit that the amount is measured ($, €, %)

  • Amount Type: Set the amount type (monetary, percentage)

You can use any combination of these options in a single validation.

Date miniApps

In Date miniApps, you have the following options:

  • Date Range: Choose the date range of the expected caller reply by selecting a specific date, the time of he call, or in general a point in the past or in the future

  • Javascript: Provide JS code that will return a boolean value (true/false) that indicates if it passes the validation

Numeric miniApps

In Numeric miniApps, you have the following options:

  • Min Length: Set the minimum number of characters

  • Max Length: Set the maximum number of characters

  • Min Value: Set the minimum value

  • Max Value: Set the maximum value

  • Regex: Set the regex pattern

  • Javascript: Provide JS code that will return a boolean value (true/false) that indicates if it passes the validation

  • In list: Set a preset list of accepted string values

  • Prebuilt: Use Credit Card Number prebuilt list. The prebuilt credit card validation checks the length of the card (to be 15 or 16 digits) and uses the Luhn algorithm to check the card validity.

You can use any combination of these options in a single validation.

Text miniApp

In Text miniApps you have the following options:

  • Regex: Set the regex pattern

  • Javascript: Provide JS code that will return a boolean value (true/false) that indicates if it passes the validation

Entity miniApp

In Entity miniApps you have the following options:

  • Regex: Set the regex pattern

  • Javascript: Provide JS code that will return a boolean value (true/false) that indicates if it passes the validation

2024-07-15_16-04-57.png

Javascript validation test

When a Javascript validation is selected it is possible to run a test to confirm that the validation works.

Javascript validation requires params.valueToValidate variable.

Example:

if(params.valueToValidate === "abc123") {
true;
} else {
false;
}

  1. Enter the JS validation code in the JS script box.

  2. Set the params object. (For example, {"valueToValidate":"abc123"})

  3. Click the Run button to see the result.

Custom Validation

In all of the above miniApps you can also have a Custom Validation which overrides any other validation. Once enabled from the corresponding toggle button, you can create your own web service that validates the n-best results based on the logic you want and returns true or false.

In case of true, it needs to return the selected n-best result.

In case of false, it needs to return the first value on the list (i.e. the one with the highest confidence, as values are arranged by confidence level).

The end point you specify by providing the URL and the request token will get all n-best results as input in the following format:

CODE
{
    "allValues": [
        { "value": "a b c", "confidence": 97.0 },
        { "value": "a d c", "confidence": 82.0 }
    ],
    "normalizedValues": [
        { "value": "abc", "confidence": 97.0 },
        { "value": "adc", "confidence": 82.0 }
    ]
}

If the validation has been successful, the result you need to return should look the following:

CODE
{
    "isValid": true,
    "nBestValue": "adc",
    "nBestConfidence": 82.0
}

If it hasn’t been successful, the result should be the following:

CODE
{
    "isValid": false,
    "nBestValue": "abc",
    "nBestConfidence": 97.0
}

For these examples, we are assuming that in the successful case "adc" has passed the validation (e.g. been found in the dictionary) - that’s why it’s returned. And in the unsuccessful case neither "abc" or "adc" were found - thats’s why the first value is returned.

Step related properties

Here you can set up step-specific properties.

Property

Description

Value

ASR Timeout

Activate and set an ASR timeout

100ms to 10000ms; increments of 100ms

2024-07-15_16-25-44.png

The active properties set up here will always override the general properties in the Properties tab.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.