Genesys Cloud - Main

 View Only

Discussion Thread View
  • 1.  Display a Comma-Separated List in a Dropdown Script Component

    Posted 7 days ago

    I have an outbound field that contains a comma-separated list of values, such as:

    111,222,333,444,555,666

    How can I display these values in a   Dropdown script component  so that each value appears as a separate selectable option?

    Any guidance or example code would be greatly appreciated!


    #ArchitectureandDesign
    #Implementation

    ------------------------------
    Thomas Stutz
    ------------------------------


  • 2.  RE: Display a Comma-Separated List in a Dropdown Script Component

    Posted 7 days ago

    Take a look at this and see if it gets you close:  Genesys Cloud - Main - Genesys



    ------------------------------
    Robert Wakefield-Carl
    ttec Digital
    Sr. Director - Innovation Architects
    Robert.WC@ttecdigital.com
    https://www.ttecDigital.com
    https://RobertWC.Blogspot.com
    ------------------------------



  • 3.  RE: Display a Comma-Separated List in a Dropdown Script Component

    Posted 6 days ago

    Hi Thomas,

    I didn't test it but do you already tried to split that string by comma to assign to a collection and use that in the drop down?

    Hope this works or lighting to the solution.

    Best regards,

    Nuno Paulo



    ------------------------------
    Nuno Paulo
    ------------------------------



  • 4.  RE: Display a Comma-Separated List in a Dropdown Script Component

    Posted 5 days ago
    Edited by Thomas Stutz 5 days ago
    In my case, the pipe ( | ) separated list contains a maximum of five parts.
    Currently, I split each part into a dynamic string variable and add these variables as items in the dropdown.
    This approach works fine, but I'm wondering if there's a simpler way to achieve this. With JS, you can simply write text.split("|")[0];
     
     
    E.g. to extract the 1st part:
     
    ifElse(equal(indexOf({{Outbound.myfield}},"|"), -1), substr({{Outbound.myfield}},0), match({{Outbound.myfield}}, "^([^|]*)", "", 1))
     
     
    2nd part:
     
    ifElse(
      equal(indexOf({{Outbound.myfield}}, "|"), -1),
      "",
      match({{Outbound.myfield}}, "^[^|]*\\|([^|]*)", "", 1)
    )
     
     
    etc...



    ------------------------------
    Thomas Stutz
    ------------------------------



  • 5.  RE: Display a Comma-Separated List in a Dropdown Script Component
    Best Answer

    Posted 5 days ago

    Hi @Thomas Stutz,

    Thomas on scripter you can use variable type "list", and assing it to a dropdown script. if the value is as you said ( 111,222,333,444,555,666 ) you will get the list dropdown showing the each number as a item.

    Regards,

    SG



    ------------------------------
    Saugort Dario Garcia
    Arquitecto de soluciones
    ------------------------------



  • 6.  RE: Display a Comma-Separated List in a Dropdown Script Component

    Posted 5 days ago

    Did Genesys ever fix the issue with passing into the script a list for a collection variable?  I know this was an issue a couple of years ago and have not tested recently.



    ------------------------------
    Robert Wakefield-Carl
    ttec Digital
    Sr. Director - Innovation Architects
    Robert.WC@ttecdigital.com
    https://www.ttecDigital.com
    https://RobertWC.Blogspot.com
    ------------------------------



  • 7.  RE: Display a Comma-Separated List in a Dropdown Script Component

    Posted 5 days ago

    Saugort Dario Garcia

    Since the outbound field ({{Outbound.myfield}}) contains a comma-separated list, how can I assign it to a list-type string variable? The variable only allows setting a static value and does not accept dynamic inputs like the outbound field.



    ------------------------------
    Thomas Stutz
    ------------------------------



Need Help finding something?

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