List Collector variable choices

ar1
Kilo Sage

Hi All,

We do have a variable set with one variable type as multiple choices and the catalog item level we have a list collector variable referred to ABC table and there is no relation b/w these two variables on ABC table level.

Now we want display the list collector variable choices based on variable set variable selected option.

Can anyone please help us.

Advance thanks/ 

4 REPLIES 4

Ankita_Patil
Tera Contributor

Hi @ar1 ,

 

You can follow the below steps -

Use a Catalog Client Script (onChange) on the Multiple Choice variable.

Dynamically set the filter of the List Collector using g_form.setValue() and g_form.setParameter(), or by rebuilding the filter dynamically.

Use a Reference Qualifier with advanced option on the List Collector variable.

Thank You !!

 

Hi Ankita,

Thanks for the reply.

We have created below client script but we're still see all the options on list collector variable level

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

    var collectorName = 'ent_type';
    var filterString = '';

    if (newValue == 'request_ent') {
        filterString = 'application=c97d08613b4b221cb63ca79c24e45a89';
    } else if (newValue == 'create_acc') {
        filterString = 'application=c97d08613b4b221cb63ca79c24e45a89^name=Entites^ORname=Time_Zone';
    }
}

Ankur Bawiskar
Tera Patron
Tera Patron

@ar1 

then if no relation then how will you know which records to be shown from ACB table based on other variable type?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,
Thanks for the response.

On ABC table we have one field called "Application", So where application field data is "Azure" those records only we need to display under the list collector variable level.

Now we want to display the choices based on multiple choice variable selected option.

Example: 
1. If multi variable option is A - We need to display all the azure application choices under the list collector variable level.


2. If the option is B - We need to display only two azure options under the list collector variable level.

Advance thanks.