Search code examples
amazon-lex

Amazon Lex - Taking user input and storing it


Is there a way to store the users input from slots? For example, the persons favourite meat is beef and bun is brioche. Then can this data be checked and returned with I recommend the Tennessee Stack that has a 6oz beef patty inside of a brioche bun.

Also, would it be possible to then have this data sent in an email automatically? Or am I asking too much?

Cheers


Solution

  • It is definitely possible, but not with Lex alone.

    You'll have to use another Amazon Web Service or your own website/server to do the emailing and storing long-term. However, storing the input short-term (the length of the chat session) is what the slots already do.

    To return a dynamic reply based on the data in the slots, you will have to handle the Lex input that is sent to a Lambda Function, and build your Lex Response there.

    Here are the documentations that should help:
    Create a Lambda Function
    Handling Lex Inputs in your Lambda Function

    There is also a video tutorial on walking you through setting up the Lex bot with Lambda and testing it out: Intro to Lex - Bot Setup With Lambda