

# Built-in slot types


Amazon Lex supports built-in slot types that define how data in the slot is recognized and handled. You can create slots of these types in your intents. This eliminates the need to create enumeration values for commonly used slot data such as date, time, and location. Built-in slot types do not have versions. 




| Slot Type | Short Description | Supported Locales | 
| --- | --- | --- | 
|  [AMAZON.AlphaNumeric](built-in-slot-alphanumeric.md)  | Recognizes words made up of letters and numbers. | 
|  [AMAZON.City](built-in-slot-city.md)  | Recognizes words that represent a city. | All locales | 
|  [AMAZON.Confirmation](built-in-slot-confirmation.md)  | Recognizes words that mean 'Yes', 'No', 'Maybe', and 'Don't know' and converts them to a standard (Yes/No/Maybe/Don't know) format. | All locales | 
|  [AMAZON.Country](built-in-slot-country.md)  | Recognizes words that represent a country. | All locales | 
|  [AMAZON.Currency](built-in-slot-currency.md)  | Recognizes words that represent a currency value and converts them into a standard currency abbreviation and value. | All locales | 
|  [AMAZON.Date](built-in-slot-date.md)  | Recognizes words that represent a date and converts them to a standard format. | All locales | 
|  [AMAZON.Duration](built-in-slot-duration.md)  | Recognizes words that represent duration and converts them to a standard format. | All locales | 
|  [AMAZON.EmailAddress](built-in-slot-email.md)  | Recognizes words that represent an email address and converts them into a standard email address. | All locales | 
|  [AMAZON.FirstName](built-in-slot-first-name.md)  | Recognizes words that represent a first name. | All locales | 
|  [AMAZON.LastName](built-in-slot-last-name.md)  | Recognizes words that represent a last name. | All locales | 
|  [AMAZON.Number](built-in-slot-number.md)  | Recognizes numeric words and converts them into digits. | All locales | 
|  [AMAZON.Percentage](built-in-slot-percent.md)  | Recognizes words that represent a percentage and converts them to a number and a percent sign (%). | All locales | 
|  [AMAZON.PhoneNumber](built-in-slot-phone.md)  | Recognizes words that represent a phone number and converts them into a numeric string. | All locales | 
|  [AMAZON.State](built-in-slot-state.md)  | Recognizes words that represent a state. | All locales | 
|  [AMAZON.StreetName](built-in-slot-street-name.md)  | Recognizes words that represent a street name. | All locales | 
|  [AMAZON.Time](built-in-slot-time.md)  | Recognizes words that indicate times and converts them into a time format. | All locales | 
|  [AMAZON.UKPostalCode](built-in-slot-uk-postal-code.md)  | Recognizes words that represent a UK post code and converts them to a standard form. | English (British) (en-GB) only | 
|  [AMAZON.FreeFormInput](built-in-slot-free-form.md)  | Recognizes strings that consist of any words or characters. | All locales | 

# AMAZON.AlphaNumeric


Recognizes strings made up of letters and numbers, such as **APQ123**.

You can use the `AMAZON.AlphaNumeric` slot type for strings that contain: 
+ Alphabetical characters, such as **ABC**
+ Numeric characters, such as **123**
+ A combination of alphanumeric characters, such as **ABC123**

The `AMAZON.AlphaNumeric` slot type supports inputs using spelling styles. You can use the spell-by-letter and spell-by-word styles to help your customers enter letters. For more information, see [Capturing slot values with spelling styles during the conversation](spelling-styles.md).

You can add a regular expression to the `AMAZON.AlphaNumeric` slot type to validate values entered for the slot. For example, you can use a regular expression to validate:
+ Canadian postal codes
+ Driver's license numbers
+ Vehicle identification numbers

Use a standard regular expression. Amazon Lex V2 supports the following characters in the regular expression:
+ A-Z, a-z
+ 0-9

Amazon Lex V2 also supports Unicode characters in regular expressions. The form is `\uUnicode`. Use four digits to represent Unicode characters. For example, `[\u0041-\u005A]` is equivalent to [A-Z].

The following regular expression operators are not supported:
+ Infinite repeaters: \$1, \$1, or \$1x,\$1 with no upper bound.
+ Wild card (.)

The maximum length of the regular expression is 300 characters. The maximum length of a string stored in an `AMAZON.AlphaNumeric` slot type that uses a regular expression is 30 characters.

The following are some example regular expressions.
+ Alphanumeric strings, such as **APQ123** or **APQ1**: `[A-Z]{3}[0-9]{1,3}` or a more constrained `[A-DP-T]{3} [1-5]{1,3}`
+ US Postal Service Priority Mail International format, such as **CP123456789US**: `CP[0-9]{9}US`
+ Bank routing numbers, such as **123456789**: `[0-9]{9}`

To set the regular expression for a slot type, use the console or the [CreateSlotType](https://docs.aws.amazon.com/lexv2/latest/APIReference/API_CreateSlotType.html) operation. The regular expression is validated when you save the slot type. If the expression isn't valid, Amazon Lex V2 returns an error message.

When you use a regular expression in a slot type, Amazon Lex V2 checks input to slots of that type against the regular expression. If the input matches the expression, the value is accepted for the slot. If the input does not match, Amazon Lex V2 prompts the user to repeat the input. 

# AMAZON.City


Provides a list of local and world cities. The slot type recognizes common variations of city names. Amazon Lex V2 doesn't convert from a variation to an official name.

Examples:
+ New York
+ Reykjavik
+ Tokyo
+ Versailles

# AMAZON.Confirmation


This slot type recognizes input phrases that corresponds to 'Yes', 'No', 'Maybe', and 'Don't know' phrases and words for Amazon Lex V2 and converts it one of the four values. It can be used to capture confirmation or acknowledgement from the user. Based on the final resolved value, you can create conditions to design multiple conversation paths.

For example:

 if \$1confirmation\$1 = "Yes", fulfill the intent

 else, elicit another slot 

Examples:
+ Yes: Yeah, Yep, Ok, Sure, I have it, I can agree...
+ No: Nope, Negative, Naw, Forget it, I'll decline, No way...
+ Maybe: It's possible, Perhaps, Sometimes, I might, That could be right...
+ Don't know: Dunno, Unknown, No idea, Not sure about it, Who knows...

As of August 17th, 2023, if there is an existing custom slot type named "Confirmation", the name must be changed to avoid conflict with the built-in slot Confirmation. In the left side navigation in the Lex console, go to the slot type (for an existing custom slot type named Confirmation) and update slot type name. The new slot type name must not be “Confirmation,” which is a reserved keyword for the built-in confirmation slot type.

# AMAZON.Country


The names of countries around the world. Examples:
+ Australia
+ Germany
+ Japan
+ United States
+ Uruguay

# AMAZON.Currency


Converts words that represent a currency into a standard ISO 4217 alphabetic currency code and a number. Amazon Lex V2 recognizes currencies but does not convert from one currency to another.

For more information, see [Currency codes - ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) on the International Organization for Standardization (ISO) website.

The currency represented is structured as follows: `{Unit} {Amount}`
+ \$1Unit\$1 refers to the specific currency unit (for example, USD).
+ \$1Amount\$1 denotes the monetary value, formatted to two decimal places (for example, 300.00).

Examples (all examples below are using the en-US locale; different locales may yield different results):
+ "3USD": USD 3.00
+ "USD300": USD 300.00
+ "3 dimes" : USD 0.30
+ "\$11.56": USD 1.56
+ "5c": USD 0.05
+ "1 dollar": USD 1.00
+ "five fifteen": USD 515.00
+ “five dollars fifteen cents”: USD 5.15
+ "5 usd and 1/2": USD 5.50

# AMAZON.Date


Converts words that represent dates into a date format.

The date is provided to your intent in ISO-8601 date format. The date that your intent receives in the slot can vary depending on the specific phrase uttered by the user.
+ Utterances that map to a specific date, such as "today," "now," or "November twenty-fifth," convert to a complete date: `2020-11-25`. This defaults to dates *on or after* the current date.
+ Utterances that map to a future week, such as "next week," convert to the date of the last day of the current week. In ISO-8601 format, the week starts on Monday and ends on Sunday. For example, if today is 2020-11-25, "next week" converts to `2020-11-29`. Dates that map to the current or previous week convert to the first day of the week. For example, if today is 2020-11-25, "last week" converts to `2020-11-16`.
+ Utterances that map to a future month, but not a specific day, such as "next month," convert to the last day of the month. For example, if today is 2020-11-25, "next month" converts to `2020-12-31`. For dates that map to the current or previous month convert to the first day of the month. For example, if today is 2020-11-25, "this month" maps to `2020-11-01`.
+ Utterances that map to a future year, but not a specific month or day, such as "next year," convert to the last day of the following year. For example, if today is 2020-11-25, "next year" converts to `2021-12-31`. For dates that map to the current or previous year convert to the first day of the year. For example, if today is 2020-11-25, "last year" converts to `2019-01-01`.

# AMAZON.Duration


Converts words that indicate durations into a numeric duration.

The duration is resolved to a format based on the [ISO-8601 duration format](https://en.wikipedia.org/wiki/ISO_8601#Durations), `PnYnMnWnDTnHnMnS`. The `P` indicates that this is a duration, the `n` is a numeric value, and the capital letter following the `n` is the specific date or time element. For example, `P3D` means 3 days. A `T` is used to indicate that the remaining values represent time elements rather than date elements.

Examples:
+ "ten minutes": `PT10M`
+ "five hours": `PT5H`
+ "three days": `P3D`
+ "forty five seconds": `PT45S`
+ "eight weeks": `P8W`
+ "seven years": `P7Y`
+ "five hours ten minutes": `PT5H10M`
+ "two years three hours ten minutes": `P2YT3H10M`

# AMAZON.EmailAddress


Recognizes words that represent an email address provided as username@domain. Addresses can include the following special characters in a user name: underscore (\$1), hyphen (-), period (.), and the plus sign (\$1).

The `AMAZON.EmailAddress` slot type supports inputs using spelling styles. You can use the spell-by-letter and spell-by-word styles to help your customers enter email addresses. For more information, see [Capturing slot values with spelling styles during the conversation](spelling-styles.md).

# AMAZON.FirstName


Commonly used first names. This slot type recognizes formal names, informal nicknames, and names consisting of more than one word. The name sent to your intent is the value sent by the user. Amazon Lex V2 doesn't convert from the nickname to the formal name.

For first names that sound alike but are spelled differently, Amazon Lex V2 sends your intent a single common form.

The `AMAZON.FirstName` slot type supports inputs using spelling styles. You can use the spell-by-letter and spell-by-word styles to help your customers enter names. For more information, see [Capturing slot values with spelling styles during the conversation](spelling-styles.md).

Examples:
+ Emily
+ John
+ Sophie
+ Anil Kumar

AMAZON.FirstName also returns a list of closely related names based on the original value. You can use the list of resolved values to recover from typos, confirm the name with the user, or perform a database look-up for valid names in your user directory.

For example, the input "John" may result in returning additional related names such as "John J" and "John-Paul". 

The following shows the response format for the `AMAZON.FirstName` built-in slot type:

```
"value": {
    "originalValue": "John",
    "interpretedValue": "John",
    "resolvedValues": [
        "John",
        "John J.",
        "John-Paul"
    ]
}
```

# AMAZON.LastName


Commonly used last names. For names that sound alike that are spelled differently, Amazon Lex V2 sends your intent a single common form.

The `AMAZON.LastName` slot type supports inputs using spelling styles. You can use the spell-by-letter and spell-by-word styles to help your customers enter names. For more information, see [Capturing slot values with spelling styles during the conversation](spelling-styles.md).

Examples:
+ Brosky
+ Dasher
+ Evers
+ Parres
+ Welt

AMAZON.LastName also returns a list of closely related names based on the original value. You can use the list of resolved values to recover from typos, confirm the name with the user, or perform a database look-up for valid names in your user directory.

For example, the input "Smith" may result in returning additional related names such as "Smyth" and "Smithe".

The following shows the response format for the `AMAZON.LastName` built-in slot type:

```
"value": {
    "originalValue": "Smith",
    "interpretedValue": "Smith",
    "resolvedValues": [
        "Smith",
        "Smyth",
        "Smithe"
    ]
}
```

# AMAZON.Number


Converts words or numbers that express a number into digits, including decimal numbers. The following table shows how the `AMAZON.Number` slot type captures numeric words.


| Input | Response | 
| --- | --- | 
| one hundred twenty three point four five | 123.45 | 
| one hundred twenty three dot four five | 123.45 | 
| point four two | 0.42 | 
| point forty two | 0.42 | 
| 232.998 | 232.998 | 
| 50 | 50 | 
| -15 | -15 | 
| minus 15 | -15 | 
| minus fifteen point two four five | -15.245 | 

# AMAZON.Percentage


Converts words and symbols that represent a percentage into a numeric value with a percent sign (%).

If the user enters a number without a percent sign or the word "percent," the slot value is set to the number. The following table shows how the `AMAZON.Percentage` slot type captures percentages.


| Input | Response | 
| --- | --- | 
| 50 percent | 50% | 
| 0.4 percent | 0.4% | 
| 23.5% | 23.5% | 
| twenty five percent | 25% | 

# AMAZON.PhoneNumber


Converts the numbers or words that represent a phone number into a string format without punctuation as follows.


| Type | Description | Input | Result | 
| --- | --- | --- | --- | 
| International number with leading plus (\$1) sign | 11-digit number with leading plus sign. |  \$161 7 4445 1061 \$11 (509) 555-1212  |   `+61744431061`   `+15095551212`   | 
| International number without leading plus (\$1) sign | 11-digit number without leading plus sign |  1 (509) 555-1212 61 7 4445 1061  |   `15095551212`   `61744451061`   | 
| National number | 10-digit number without international code |  (03) 5115 4444 (509) 555-1212  |   `0351154444`   `5095551212`   | 
| Local number | phone number without an international code or an area code | 555-1212 |  5551212  | 

# AMAZON.State


The names of geographical and political regions within countries. 

Examples:
+ Bavaria
+ Fukushima Prefecture
+ Pacific Northwest
+ Queensland
+ Wales

# AMAZON.StreetName


The names of streets within a typical street address. This includes just the street name, not the house number.

Examples:
+ Canberra Avenue
+ Front Street
+ Market Road

# AMAZON.Time


Converts words that represent times into time values. `AMAZON.Time` can resolve exact times, ambiguous values, and time ranges. The slot value can resolve to the following time ranges:
+ AM
+ PM
+ MO (morning)
+ AF (afternoon)
+ EV (evening)
+ NI (night)

When a user enters an ambiguous time, Amazon Lex V2 uses the `slots` attribute of a Lambda event to pass resolutions for the ambiguous times to your Lambda function. For example, if your bot prompts the user for a delivery time, the user can respond by saying "10 o'clock." This time is ambiguous. It means either 10:00 AM or 10:00 PM. In this case, the value in the `interpretedValue` field is `null`, and the `resolvedValues` field contains the two possible resolutions of the time. Amazon Lex V2 inputs the following into the Lambda function:

```
"slots": {
    "deliveryTime": {
    "value": {
        "originalValue": "10 o'clock",
        "interpretedValue": null,
        "resolvedValues": [
            "10:00", "22:00"
        ]
    }
}
```

When the user responds with an unambiguous time, Amazon Lex V2 sends the time to your Lambda function in the `interpretedValue` field of the `slots` attribute of the Lambda event. For example, if your user responds to the prompt for a delivery time with "10:00 AM," Amazon Lex V2 inputs the following into the Lambda function:

```
"slots": {
    "deliveryTime": {
        "value": {
        "originalValue": "10 AM",
        "interpretedValue": 10:00,
        "resolvedValues": [
            "10:00"
        ]
    }
}
```

When the user responds to a prompt for a delivery time with "in the morning," Amazon Lex V2 inputs the following into the Lambda function:

```
"slots": {
    "deliveryTime": {
    "value": {
        "originalValue": "morning",
        "interpretedValue": "MO",
        "resolvedValues": [
            "MO"
        ]
    }
}
```

For more information about the data sent from Amazon Lex V2 to a Lambda function, see [AWS Lambda input event format for Lex V2](lambda-input-format.md).

# AMAZON.UKPostalCode


Converts words that represent a UK postal code to a standard format for postal codes in the United Kingdom. The `AMAZON.UKPostalCode` slot type validates and resolves the post code to a set of standardized formats, but it doesn't check to make sure that the post code is valid. Your application must validate the post code.

The `AMAZON.UKPostalCode` slot type is available only in the English (UK) (en-GB) locale.

The `AMAZON.UKPostalCode` slot type supports inputs using spelling styles. You can use the spell-by-letter and spell-by-word styles to help your customers enter letters. For more information, see [Capturing slot values with spelling styles during the conversation](spelling-styles.md).

The slot type recognizes only the valid post code formats listed below, used in the United Kingdom. The valid formats are ("A" representis a letter, and "9" represents a digit):
+ AA9A 9AA
+ A9A 9AA
+ A9 9AA
+ A99 9AA
+ AA9 9AA
+ AA99 9AA

For text input, the user can enter any mix of upper and lower case letters. The user can use or omit the space in the post code. The resolved value will always include the space in the proper location for the post code.

For spoken input, the user can speak the individual characters, or they can use double letter pronunciations, such as "double A" or "double 9". They can also use double-digit pronunciations, such as "ninety-nine" for "99". 

**Note**  
Not all UK postal codes are recognized. Only the formats listed above are supported.

# AMAZON.FreeFormInput


`AMAZON.FreeFormInput` can be used to capture free form input from the end user. It recognizes strings that consist of words or characters. The resolved value is the entire input utterance.

Example:

Bot: Please provide feedback from your call experience. 

User: I got the answers to all of my questions, and I was able to complete the transaction.

Note:
+ `AMAZON.FreeFormInput` can be used to capture free form input as-is from the end user.
+ `AMAZON.FreeFormInput` cannot be used in intent sample utterances.
+ `AMAZON.FreeFormInput` cannot have slot sample utterances.
+ `AMAZON.FreeFormInput` is only recognized when elicited for.
+ `AMAZON.FreeFormInput` does not support wait and continue.
+ `AMAZON.FreeFormInput` is currently not supported in the Amazon Connect Chat channel.
+ When a `AMAZON.FreeFormInput` slot is elicited, `FallbackIntent` will not be triggered.
+ When a `AMAZON.FreeFormInput` slot is elicited, there will be no intent switch.