Genesys Cloud - Main

 View Only

Discussion Thread View
  • 1.  Bot Flow - Slot Type Regex

    Posted 02-17-2023 10:16

    Hello everyone, 
    I am trying to develop a bot internally in Genesys Coud.
    In my Bot Flow, I need to ask the user for an alphanumeric code (for example AGXX002299). 

    To do this, I created a Regex slot type and I use this regex: [a-zA-Z0-9 ,  .*]+ 

    However,  when I pronounce the code, he understands it with spaces, i.e. collect: "AG XX 002 299" (I found this out by printing the Session.LastCollectionUtterance).
    But there is a problem: in the slot it saves only the first occurrence it finds without a space, i.e. in the slot it saves me only "AG".
    I want the slot to capture the full code. How do I get the full code to save in the slot? (It's okay even with spaces, as long as the alphanumeric part is all of it).
    Even if the code consists of "multiple parts", it must save it all in the same slot.

    Maybe, I got the Regex wrong?! But I have tried the different codes in the "Test Utterance"  and each time it matches them with the regexes correctly. (I have tried also in https://regexr.com/). 

    Can you help me?

    Thanks in advance,

    Sere


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

    ------------------------------
    Serena Spaccesi
    Indra Italia spa
    ------------------------------


  • 2.  RE: Bot Flow - Slot Type Regex

    Posted 02-17-2023 12:48

    Hi,

    I assume you are using a voice bot as you mentioned "pronounced". This can be tricky with voice bot but you can confirm with Slot as well as use a custom validator (in Ask for Slot Action). 

    I was able to get it working with your regex. However, you may want to change this to make it more restrictive such as \b[a-z]{4}[0-9]{6}\b. Note that Session.LastCollectionUtterance and Slot.YourSlotName can be different. 

    Hope this helps



    ------------------------------
    Matthew Raleigh
    Thermo Fischer CRG
    Sr. IT COMM Eng.
    ------------------------------



  • 3.  RE: Bot Flow - Slot Type Regex

    Posted 02-20-2023 11:22

    Hi  Matthew,

    Thank you very much for your help!!! I seem to have solved the problem thanks to your help. With your Regex it was always getting me only the first few characters, however with some modification it seems to be working fine (I just duplicated your regex several times!!!)
    Apparently, it seems that Genesys Cloud does not like Regex with quantifiers * or + but wants the specific range of the number of characters.
    I just have to do more tests to see if I have covered all the cases.

    Grateful for your help!!

    Best Regards,

    Serena



    ------------------------------
    Serena Spaccesi
    Indra Italia spa
    ------------------------------



  • 4.  RE: Bot Flow - Slot Type Regex

    Posted 02-20-2023 12:01

    Awesome, I am glad it helped. 



    ------------------------------
    Matthew Raleigh
    Thermo Fischer CRG
    Sr. IT COMM Eng.
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources