Session Attributes
Lesson 1 of 2
  1. 1
    In this lesson, we’re going to build a Codecademy Flashcards skill and look at how you can program Alexa to remember details about your conversation within a session — the time between when y…
  2. 2
    Before we build the Lambda function logic for our flashcards skill, we want to build the interaction model. To do so, we’ll navigate to developer.amazon.com and use the Alexa Skill Builder. If …
  3. 3
    Let’s take a look at how we access session attributes from a Lambda function. Session attributes are stored in the response that your skill receives from Alexa as a JSON. We can create and edit a…
  4. 4
    Like variables, session attributes hold values that we can change after we’ve created them. For example, if any of our session attributes are numbers, we can set their initial values and use numbe…
  5. 5
    One good use of session attributes is to capture and store user input through slots so you can use that information at a later time. This information is sent to your Lambda function as part of the …
  6. 6
    Often, you want to combine session attribute values with another string to generate a custom speech output. Let’s consider our movie genre skill. If we wanted Alexa to respond with the current ge…
  7. 7
    In the last exercise, we used interpolation to create a speech output. Though, accessing session attributes and slot values can get messy. In this exercise we’ll see how variables can help us clean…
  8. 8
    Now that we’ve added all of the functionality of session attributes, let’s create our Lambda function. We’ve detailed the steps below, but if you need a refresher, check out this video on creatin…
  9. 9
    Now that we’ve completed our skill, let’s test it out. We’ve included our version of the service simulator to let you see how the requests and responses should appear. Try out the following utter…
  10. 10
    Congratulations! You now know how to persist data throughout an Alexa session. Let’s review what you learned: - We define session attributes using key: value pair syntax. - You can modify session …

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo