Notifications

8 views

Description

When trying to load the values into a list collector variable using a catalog client script, the list collector variable becomes empty after loading a certain number of choices (35).

Steps to Reproduce

  1. Hop to a London instance
  2. Navigate to 'sc_cat_item' table and select any item (for example Standard laptop)
  3. Create two new variables of type List collector and checkbox in the variables related list.

    i. Variable 1:
    Type: checkbox
    Question: testbox
    Name: testbox
    Submit it.
    ii. Variable 2:
    Type: List collector
    Questions: test
    Name: test
    click on 'Type Specification' : List table: Incident.
    Submit it.
  4. Navigate to the catalog item you selected in step 2 (i.e Standard Laptop) and click on the 'New' button on the 'Catalog client Scripts' related list and fill in the below details.

    Name: Set list collector
    UI type: All
    Type: Onchange
    Variable Name: testbox (name of the checkbox variable created in step 3)
    Script:


    function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
    return;
    }

    //Type appropriate comment here, and begin script below

    if(testbox)
    {
    var a = [];
    var gr = new GlideRecord("incident");
    gr.query(function (gr){
    while(gr.next()){
    a.push(gr.sys_id);

    }
    g_form.setValue('test', a);
    });

    }

    else
    {
    g_form.setValue("test", "");
    }
    }

    Save the catalog client script.
  5. Navigate to that catalog item in service portal.
    https://instancename.service-now.com/sp?id=sc_cat_item&sys_id=04b7e94b4f7b4200086eeed18110c7fd (standard laptop catalog item).
  6. Select the checkbox 'testbox'

    Please note that the list collector variable 'test' is empty.

    Expected behavior: All the choices should be loaded in the List collector.

    Actual behavior: The list collector is empty.

    Please Note: If you pass in a third parameter display value the issue is resolved when the items added to the list collector is greater than 35 items.

    g_form.setValue('<variable_name>', '<sys_id_array>', '<display_name_array>');

    sys_id_array < 35 items (sys_id) doesn't have this issue

Workaround

This problem has been fixed. If you are able to upgrade, review the Fixed In or Intended Fix Version fields to determine whether any versions have a planned or permanent fix.

 


Related Problem: PRB1327287

Seen In

SR - Security - Integration Framework - Madrid 2019 Q2
SR - Security - Support Common - Madrid 2019 Q2
SR - Security - Support Orchestration - Madrid 2019 Q2
SR - SIR - Security Incident Response - Madrid 2019 Q2
SR - SIR - Store SecOps Setup Assistant - Madrid 2019 Q2
SR - SIR - Store Threat Core - Madrid 2019 Q2
SR - SIR - Store Trusted Security Circles Client - New York 2019 Q3
SR - VR - Rapid7 - London 2019 Q2 v.6.2.1
SR - VR - Vulnerability Response - New York 2019 Q3

Fixed In

New York

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-12-19 13:29:26
Published:2019-12-19