Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Regex slot type in digital bot is not validating customer input data properly

    Posted 07-08-2025 15:47
    No replies, thread closed.

    I have created a digital bot where customer name will be taken as input with slot type Regular Expression to specify below patterns. 

    1. Minimum length will be 1 and maximum length will be 17 characters
    2. Only alphabets and numbers are allowed
    3. No special characters are allowed

    I have created the slot type with the regex pattern as ^[a-zA-Z0-9]{1,17}$ . When I am doing NLU test in slot type window, it is validating the scenarios. But when I'm using it with "Ask for Slot" action in bot, it is accepting all the input with special characters and not throwing any "No Match" message configured in the action. Surprisingly when printing the value with set participant data it is only showing the name without special characters. 

    I don't want this behavior, rather I want to through the "No Match" message and does not allow user to go next step. Please suggest your valuable input to achieve the use case and correct me if I am doing any mistake.

    Added some screenshot for reference. 1. NLU Test not accepting incorrect input pattern, 2.Bot flow to get name and 3. Behavior in bot - Not throwing an error message 


    #ConversationalAI(Bots,AgentAssist,etc.)
    #DigitalChannels
    #Implementation
    #PlatformAdministration

    ------------------------------
    Subhajit Podder
    NA
    ------------------------------


  • 2.  RE: Regex slot type in digital bot is not validating customer input data properly

    Posted 07-09-2025 09:14
    No replies, thread closed.

    Hello Subhajit, 

    The behavior you're seeing is due to how the bot flow processes input versus how the NLU testing works. The bot is actually performing a "sanitization" of the input before storing it, which is why you see the special characters removed in the Set Participant Data action. However, this happens after the validation step. This is why you are seeing the special characters. 

    I can think you can get around this if you "Ask for Slot" action, add an additional validation step. Configure the "Validation" section of the Ask for Slot action. Set up a custom validation expression that matches your regrex pattern. Then configure the error message to be shown when the validation fails. 

    To be specific to your issue:

    Enable input validation > Set the validation pattern to match your regex: ^[a-zA-Z0-9]{1,17}$ > configure your "No Match" message > set "Retry on Failure" to Yes. 

    Make sure the flow branches based on the validation result:

    Success: Continue to your next step

    Failure: Return to asking for input. 

    Hope this helps!



    ------------------------------
    Cameron
    Online Community Manager/Moderator
    ------------------------------



  • 3.  RE: Regex slot type in digital bot is not validating customer input data properly

    Posted 07-09-2025 10:29
    No replies, thread closed.

    Thank you Cameron for the explanation. Custom validation is a good option. Is there any way of validation to match the regex: ^[a-zA-Z0-9]{1,17}$ pattern, as I know there is no such function available in Architect?

    The only way I can think of checking the special characters one by one with Contains() function within the input string.



    ------------------------------
    Subhajit Podder
    NA
    ------------------------------



  • 4.  RE: Regex slot type in digital bot is not validating customer input data properly

    Posted 07-09-2025 11:02
    No replies, thread closed.

    Hello Subhajit, 

    There isn't a function like what you are looking for in Architect. You are correct you would have to check special characters one by one. 

    Cheers, 



    ------------------------------
    Cameron
    Online Community Manager/Moderator
    ------------------------------