Skip to content

How to get inputTranscript i.e. customers first words in a Lex bot back into Amazon Connect flow

0

I have a Lex VOICE bot that asks.."What can I help you with today?" when it is first invoked. I am wondering if there's an easy way to capture the customer's first words transcribed as text so I can pass that back to the Amazon Connect flow? I think I can do in Lambda but hoping there is already a variable I could pull from the bot. One less Lambda. hoping ;)

2 Answers
0

The list of attributes that Lex returns to back to contact flow are listed in the URL here: https://docs.aws.amazon.com/connect/latest/adminguide/connect-attrib-list.html#attribs-lex-table

The captured utterance is not one of them. I can suggest some methods but I can only think about some Lambda based integration.

Might as well ask, what's the use case you trying to achieve?

answered 2 years ago
0

Hi Ricky,

To capture the user's initial spoken input in Lex, you can retrieve it like this:

first_input = event.get("inputTranscript", "").strip().upper() or event.get("rawInputTranscript", "").strip().upper()

This captures the first utterance regardless of the intent — even if it's handled as a FallbackIntent, the input is still available.

Once the user provides input, you can handle that initial interaction directly. For example, asking for a full name like "Juan Perez Martinez" using multiple slots can be tricky. With first_input, you already have the raw transcription ready for processing.

I recommend storing this value in session attributes, for example: session_attributes["captured"] = "200"

This way, you can mark that the initial input was captured and ensure first_input is not reused later in the flow.

answered 7 months 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.