CA Service Management

 View Only

Getting multiple selections from a dual list

  • 1.  Getting multiple selections from a dual list

    Posted Dec 31, 2019 11:08 AM
    Edited by TED HOOSICK Jan 02, 2020 09:13 AM
    Hi,

    I am building a form in Service Catalog 17.2 I have a Dual List populated using options (currently 10 possible selections).
    I need to pull the selected options by value into a text var that I can use to populate the description field. I have done this with text fields and single select components using Java script calls. I have not been successful with the Dual List using "ca_fdGetSelectedOptionValues". I am obviously missing something or don't understand how the function works... 

    Update: found a typo in my var statement. It now works as expected...
    This is how I pulled the selection from a dual list and appended it to the description... (form script)
    memGrp_list is the dual list id

    //ca_fd.js.updateGroups() *******Groups*********
    updateGroups: function() {
    var mem_Grps= "\r Membership Groups: " + ca_fdGetSelectedOptionValues(ca_fd.formId,'memGrp_list');
    var actualDescription = ca_fdGetTextFieldValue(ca_fd.formId,"ca_sdm_attr_description");
    ca_fdSetTextFieldValue(ca_fd.formId,"ca_sdm_attr_description", actualDescription + mem_Grps);
    return true;
    },

    Thanks,
    Ted