The CreatorCon Call for Content is officially open! Get started here.

Lookup Select Box - how to change depending on another lookup select box

L_10
Kilo Contributor

Hi community,

I have trouble changing options of a lookup select box, and I couldn't find past articles which can help my situation.

 

Lookup Selection Box A: where users choose item name to order (there are a lot of items to be ordered packed in a service catalog... this may be a cause of this trouble...)

Lookup Selection Box B: where users choose item size, and displayed size option should depend on the option selected in A.

 

Both options are referenced from the same master table.

However, the query filter seems somehow only work within the table.

Such as, when I set to 

type | is | for men

it worked.

However, when I set to 

item name | is same as | <value of A>

it didn't.

btw, I first switched to the type to "Reference" instead of "Lookup~" and I set the Reference qualifier condition.

The condition seemed ok, but when I switched to "Lookup~", the reference qualifier said,

item name | is same as | item name (the same field of the same table)

 

Is there any way to rewrite this reference qualifier or create Client Script to work it just as I want? 

I also failed to work with a client script... (see the image & script below, please)

find_real_file.png

 

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

//Type appropriate comment here, and begin script below
g_form.clearOptions('u_item_size_women');

var choice = new GlideRecord('u_uniform_item_master');
choice.addQuery('u_item_name', newValue);
choice.query();
while(choice.next()){
g_form.addOption('u_item_name',choice.u_item_size);
}
}

Thank you!

7 REPLIES 7

Sorry for the late reply. Is the issue resolved? If not, could you share a screenshot of the lookup variable?

From the above info, it looks fine to me.

Slawek_Radziewi
Kilo Sage

Hi

I did reference qualifier below way where it is dependant on different variable in the item.

 

find_real_file.png

Thank you Slawek,

 

Do I need to write also the table name in Reference qual?

Such as;

javascript:'<table name>.<column name>STARTSWITH'+current.variables.<variable set name>.<variable name>;

 

In my case;

javascript: 'u_uniform_item_master.u_item_name='+current.variables.u_vset_women.u_item_name_women;

 

It still didn't work...

Do you mind to help me a little more please?