Simple variable types
Simple variables created in Mix.dialog are of a specified type. When you send a variable, whether in the StartRequest payload or in a data access action, you must make sure to send the data in the right format so that it can be used by the dialog application.
This table lists the types of simple variables and describes how to send them to the dialog application.
Variable type | Description |
---|---|
String | String of characters |
Alphanumeric | String of alphanumeric characters (a-z, A-Z, 0-9) |
Digits | String of digits (0-9) |
Boolean | Boolean (true, false) |
Integer | Whole number |
Decimal | Decimal-point number |
Amount | Amount, including currency. Specify the amount in an object with the following elements:
|
Date | Date (YYYYMMDD) |
Time | Time. Specify as a string using the format HHMMx , where x is one of the following:
|
Distance | Distance, including unit and modifier. Specify the distance in an object with the following elements:
unit and modifier values supported. |
Temperature | Temperature, including unit. Specify the temperature in an object with the following elements:
unit values supported. |
This example shows how to pass this type of data in a data access action:
{
"selector": {
"channel": "default",
"language": "en-US",
"library": "default"
},
"payload": {
"requested_data": {
"id": "DataAccess",
"data": {
"returnCode": "0",
"sampleString": "This is a sample string",
"sampleAlphanumeric": "1-2 This is an alphanumeric string.",
"sampleDigits": "12",
"sampleBoolean": "true",
"sampleInt": 27,
"sampleDecimal": 12.34,
"sampleAmount": {
"unit": "USD",
"number": 10.5
},
"sampleDate": "202001014",
"sampleTime": "1212a",
"sampleDistance": {
"modifier": "LE",
"unit": "km",
"number": 10
},
"sampleTemperature": {
"unit": "C",
"number": 32
}
}
}
}
}
For more information, see Variable types in the Mix.dialog documentation.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.