Genesys Cloud - Main

 View Only

Discussion Thread View
  • 1.  Agent Script dynamic variables function

    Posted 10-11-2024 06:02

    Good day,

    hope someone can assist with the below.

    I have a requirement to implement and agent script that needs to check the length of digits entered and if it consist of the country code.

    i am looking at a dynamic variables (Boolean), if true a button will be displayed, if false, button will not be visible.

    the below is what i have

    1.  equal(length({{XferTo}}), 12) - Returns the length of entered digits
    2. substr({{XferTo}}, 0, 3) - returns the country could

    the problem i have is to implement the above onto 1 x dynamic variables (Boolean) and an and statement, i have tried the below but not working, any assistance will be appreciated.

    equal(length({{XferTo}}), 12) & equal(substr({{XferTo}}, 0, 3)), "+**")


    #Implementation

    ------------------------------
    Reginald
    ------------------------------


  • 2.  RE: Agent Script dynamic variables function
    Best Answer

    Posted 10-11-2024 08:46

    Hello Reginald,

    If you just want to check if it starts with + and if it's 12 digits you should be able to use

    match({{XferTo}}, "^[+][1-9][0-9]{10}$")

    This would be true if the string length is 12, contains a + and the second digit isn't 0 which it wouldn't be for a country code.

    You could adjust it if you want to check for a specific country code or different lengths etc.



    ------------------------------
    Jan Heinonen
    Contact Center Specialist
    GlobalConnect AB
    ------------------------------



  • 3.  RE: Agent Script dynamic variables function

    Posted 10-11-2024 11:08

    Thanks for the prompt response, this worked



    ------------------------------
    Reginald
    ------------------------------



Need Help finding something?

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