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.
![](../__attachments/1280966676/2023-01-18_14-01-33.png?inst-v=fb1dbfbe-88b2-4c81-b292-31c5935aaef1)
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.
![](../__attachments/1280966676/2023-01-18_13-51-52.png?inst-v=fb1dbfbe-88b2-4c81-b292-31c5935aaef1)
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.
![](../__attachments/1280966676/2023-01-18_13-55-53.png?inst-v=fb1dbfbe-88b2-4c81-b292-31c5935aaef1)
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
![](../__attachments/1280966676/2023-01-18_13-57-22.png?inst-v=fb1dbfbe-88b2-4c81-b292-31c5935aaef1)
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.
![](../__attachments/1280966676/2023-01-18_13-59-09.png?inst-v=fb1dbfbe-88b2-4c81-b292-31c5935aaef1)
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
![](../__attachments/1280966676/2023-06-29_16-52-56.png?inst-v=fb1dbfbe-88b2-4c81-b292-31c5935aaef1)
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](../__attachments/1280966676/2024-07-15_16-04-57.png?inst-v=fb1dbfbe-88b2-4c81-b292-31c5935aaef1)
Javascript validation test
When a Javascript validation is selected it is possible to run a test to confirm that the validation works.
![](../__attachments/1280966676/2023-01-18_13-49-50.png?inst-v=fb1dbfbe-88b2-4c81-b292-31c5935aaef1)
Javascript validation requires params.valueToValidate
variable.
Example:
if(params.valueToValidate === "abc123") {
true;
} else {
false;
}
Enter the JS validation code in the JS script box.
Set the params object. (For example,
{"valueToValidate":"abc123"}
)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:
{
"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:
{
"isValid": true,
"nBestValue": "adc",
"nBestConfidence": 82.0
}
If it hasn’t been successful, the result should be the following:
{
"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](../__attachments/1280966676/2024-07-15_16-25-44.png?inst-v=fb1dbfbe-88b2-4c81-b292-31c5935aaef1)
The active properties set up here will always override the general properties in the Properties tab.