Lex V2 Bot Failing to Build - Conditionals

0

We have a Lex V2 bot that's been working fine that we recently decided to add a new intent. It's failing to build because of conditionals on intents that was previously working that we have not touched.

One of many errors Invalid conditional expression in intent 'ModifyCheckOutDate'. Invalid expression: fn.IS_SET([reservationId]) = "TRUE" AND fn.IS_SET({CheckOutDate}) = "FALSE"

This conditional was building fine before and we checked the documentation and it appears to be valid.

ashih
asked a year ago325 views
1 Answer
0

https://docs.aws.amazon.com/lexv2/latest/dg/paths-branching.html

it appears the issue might be due to a combination of the following factors:

The function fn.IS_SET() is used to check if a slot, session attribute, or request attribute is set in the current session and it seems to be used correctly in your conditional expression according to the official Amazon Lex documentation​1​.

There have been instances where such error messages hint at issues with the version of SDK/CLI on the client's end. Ensuring you are using the most recent AWS CLI version or updating/upgrading your SDK version might resolve the issue​2​.

It's also worth noting that Amazon Lex V2 released a change on August 17, 2022, that affected how conversations are managed with the user. Bots created before this date do not support certain features such as dialog code hook messages, setting values, configuring next steps, and adding conditions. It's possible that this change might have impacted your bot, especially if it was created before this date​. (Just as a note)

profile picture
EXPERT
answered a year ago
  • Our bot was created after August 2022 and we're configuring the intents and subsequently these conditionals inside the Lex console, so we are not using SDK/CLI. Are there other reasons why this might be failing?

  • the other reasons may be

    Incorrect use of brackets or braces: According to the Amazon Lex documentation, you need to use {} to reference a slot value, and [] to reference a session attribute. From the error message you shared, it seems you're using [] for reservationId, which should be a slot value, not a session attribute, based on the usual naming conventions. Make sure you're using the correct brackets or braces for your reference

    fn.IS_SET([reservationId]) = "TRUE" AND fn.IS_SET({CheckOutDate}) = "FALSE"

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