Genesys Cloud - Main

 View Only
Discussion Thread View
  • 1.  How To Populate Radio Button With Content From String Variable

    NEW MEMBER
    Posted 27 days ago

    Hey folks,

    Happy Monday (well it's Monday here... :-)),

    I am having joyous fun trying to find ways of populating a Contact Centre Scripts Radio Button with text Content which is sourced from a String Variable which has Comma Delimited content within the container.

    Architect has the ability to Split String content, based on a definable delimiter, but to date I have found nothing which enables a similar capability, that will assist in populating a Radio Button, hosted on a Script.

    The issue also being that the Comma Delimited content is not of a fixed length, per record, and the number of items which may be populated in the String Flattened array may vary between 1 and 15 items.

    Does ANYONE know of a way that a Script hosted Radio Button array can be populated dynamically, from a Comma Delimited String source?

    I have attempted to populate a list using Dynamic String Variables, List String Variables, and a variety of potential commands, including ToString({var Name}, ","), and nothing has worked so far.

    Yours in desperation,

    Catelyn


    #Omni-ChannelDesktop/UserInterface
    #Unsure/Other

    ------------------------------
    Catelyn Hearne
    Red Energy Pty Ltd.
    ------------------------------


  • 2.  RE: How To Populate Radio Button With Content From String Variable

    Posted 25 days ago

    You could use a velocity macro or other markup language to get there, but easiest just to use Architect to assign each to their own variable and in the Set Screen Pop tool.  If you already have a collection, it is a simple GetAt and assign each button variable.  



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



  • 3.  RE: How To Populate Radio Button With Content From String Variable

    Posted 9 days ago

    Catelyn, I have a solution that I seemed to work in my testing.

    Begin by setting your comma separated string value as participant data in your flow. In my example it's called "ListFromFlow". You can set it as shown, or if you have a collection in Architect, you can use the ToString function and specify a comma as the delimiter.

    Next, in your script, click Script in the upper left, then Script Properties, then scroll down the bottom to where you see List and toggle it on. 

    Next, create a List String variable with the name "ListFromFlow" with the input value enabled.

     Next, create a String variable to hold the radio button selection, in my example it is 'radio_value'.

    Then you will create two sets of variables, one for the content of the radio button and one to control it's visibility. You mentioned a max of 15, so you will create 15 of each as follows.

    Dynamic String variable -- repeat this pattern until you have 15 total.

    name = rbo_00, value = getIndexValue({{ListFromFlow}}, 0)

    name = rbo_01, value = getIndexValue({{ListFromFlow}}, 1)

    .....

    Dynamic True/False variable -- repeat this pattern until you have 15 total.

    name = rbv_00, value = ifElse(length({{rbo_00}})>0,true,false)

    name = rbv_01, value = ifElse(length({{rbo_01}})>0,true,false)

    .......

    When creating the dynamic values, you should use the insert variable option instead of just referencing them with {{xx}}. In my experience, the script didn't work if I entered them manually.

    Next, on your page you will add your radio buttons. This will be for the first button, but repeat the patter till you get to your max number.

     Text={{rbo_00}}

    Value = radio_value

    Selected Value Text = {{rbo_00}}

    Click Layout, scroll down to Visible and select rbv_00

    Shortening the string that you pass in from Architect will shorten the number of radio buttons that are visible. 

    Hope this helps.



    ------------------------------
    Kevin Goodwin
    Mediu, Inc.
    ------------------------------



  • 4.  RE: How To Populate Radio Button With Content From String Variable

    Posted 9 days ago

    Super helpful and well-crafted post Kevin.  



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



Need Help finding something?

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