Search code examples
amazon-web-servicesaws-lambdaamazon-lexamazon-connect

AWS Connect and Lex - Cannot reference Contact Attribute


For reference, here is the flow in question:

"Get Customer Input" (Lex) -> "Set Contact Attribute" -> "Play Prompt"

After the call to Lex, I set a contact attribute using "Save Text As Attribute" option:

DestinationKey Value ProductType $.Lex.SessionAttributes.ProductType

Then, in the "Play Prompt" I can't reference the set attribute. I use "Text to speech (Ad hoc)" and have tried the following syntax:

  • $.ProductType
  • $.System.ProductType
  • $.User.ProductType
  • $.External.ProductType

The interesting thing is, if I add a "Check contact attributes" after the "Set contact attributes" it does match on "User Defined" attribute "ProductType".

How may I reference the attribute?


Solution

  • Try $.Attributes.ProductType

    $.Attributes is how you get to contact attributes set with Set Contact Attribute. $.External is to get to the values returned by the last Lambda execution. $.Lex for the last Lex execution.