By using AWS re:Post, you agree to the AWS re:Post Terms of Use

Amazon Lex/AWS Connect - Capital Letter for First Name

0

Hi,

I have an AWS Connect instance that uses a Lex Intent.

I have a slot for Amazon.FirstName

If a customer enters "john", it doesn't capitalise the first letter. Is there a way convert the entry to "John", so that it always capitilises the first letter of the name?

2 Answers
1

Refer to this document, you can using Fulfillment code hook to solve that. Just add some line of code to edit payload input, then return modified value with: word.capitalize() in your lambda function.

Step by Step guidance here:

profile picture
answered 20 days ago
0

Unfortunately, Amazon Lex does not automatically capitalize the first letter of names entered into the AMAZON.FirstName slot type. The slot type recognizes various forms of first names, including formal names, informal nicknames, and multi-word names, but it does not modify the input provided by the user.

When a user enters a name like "john" into an AMAZON.FirstName slot, Lex will send the exact value entered by the user to your intent. It does not perform any automatic capitalization or conversion from nicknames to formal names.

If you need the first letter of the name to be capitalized, you would need to implement this logic in your own code after receiving the slot value from Lex. This could be done in a Lambda function that processes the intent, or in your AWS Connect flow after receiving the value from Lex.

For example, you could create a function that takes the slot value and applies the necessary capitalization. This way, you can ensure that names are consistently formatted with a capital first letter, regardless of how the user entered them.

Keep in mind that while this approach would work for simple cases like "john" to "John", it may not handle more complex names or multi-word names correctly. You might need to implement more sophisticated logic to handle various name formats appropriately.
Sources
AMAZON.FirstName - Amazon Lex
AMAZON.FirstName - Amazon Lex V1

profile picture
answered 20 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions