Scripted Choice list

Woz
Tera Contributor

Hello,

I have a script seen below to return values from a table. I want to use this script to create a choice list. Where do I need to put the script (Its a client callable script include)

 

function bsFilter(bsCategory,bsCatalogue){
    var lookup,
    list = [],
    returnString;    

    lookup = new GlideRecord("my_table");
    lookup.addQuery("my_table",bsCategory);
    lookup.addQuery("my_table",bsCatalogue);

    while(lookup.next()){
        list.push(lookup.getUniqueValue());
    }

    returnString = "sys_idIN"+list.join(',');

    return returnString
}

5 REPLIES 5

Arnoud Kooi
ServiceNow Employee
ServiceNow Employee

Seems your working with a Reference field, not choice list.
Look into Reference qualifiers