Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Script Variable Date Format

    Posted 10-25-2022 15:43
    No replies, thread closed.

    Hello, 

    We are building an inbound script for our agents and one of the options they have is to select the scheduled date they find for the customer while on the call (using the Date/Time container). When they pick a date and time, we have a variable in the later section of the script (their recap) automatically populate the date and time chosen. 

    Is there a way to change the format to appear as mm/dd/yyyy hh:mm AM/PM? It currently appears as: 2022-10-25T19:00:43+0000 


    Thank you.


    #Unsure/Other

    ------------------------------
    WFM4Life
    ------------------------------


  • 2.  RE: Script Variable Date Format

    Posted 10-26-2022 22:23
    No replies, thread closed.
    You can use expressions to create a new variable through a custom action on a page or button press.  For this, I would use substr, which is described here:  Additional functions to use in dynamic variables - Genesys Cloud Resource Center (mypurecloud.com)

    So, for yours:  2022-10-25T19:00:43+0000
    You could assign a variable that is:
    substr(5,2)
    "-"
    substr(8,2)"
    "-"
    substr(0,4)
    " at "
    substr(11,5)

    Which should give you 10-25-2022 at 19:00

    You may need to play around with the formatting.   

    substr(string, start[, length])

    This function returns a substring of the original string, starting from the zero-based start position. If length is specified, it returns that many characters, and otherwise, it returns the rest of the string.

    Examples:
     substr("ABCD", 1) //returns "BCD"
     substr("ABCD", 2, 1) //returns "C"
     substr("ABCD", 5) //returns ""


    ------------------------------
    Robert Wakefield-Carl
    Avtex Solutions, LLC
    Contact Center Innovation Architect
    https://www.Avtex.com
    https://RobertWC.Blogspot.com
    ------------------------------



  • 3.  RE: Script Variable Date Format

    Posted 10-27-2022 12:18
    No replies, thread closed.

    Hi Robert, 

    I was not familiar with the string functions ability to return the different sections. This was very helpful and should be what we needed! Thank you.



    ------------------------------
    WFM4Life
    ------------------------------