How to show and remove options in List Collector variable catalog item

Shalika
Tera Expert

I have a catalog item with variable as List collector named "Location" and another variable "Selection of needed areas" which is also List collector. Both the variables are referencing to the same table as shown

Shalika_0-1669604363234.png

 

Shalika_1-1669604382777.png

The location field has values Singapore and Porvoo. The "Selection of needed areas" field has 4 values p1,p2,p3 and p4. I want that if a user selects Singapore location then the 1st 3 values p1,p2,p3 should display and if Porvoo is selected p4 should display. How can I do this?

 

1 ACCEPTED SOLUTION

Murthy Ch
Giga Sage

Hi @Shalika 

You can try below logic in reference qualifier:

javascript:
var arr=[];
if(current.variables.u_location.indexOf("Singapore sys_id")>-1)
{
arr.push("p1 sys_id","p2 sys_id","p3 sys_id");
}
if(current.variables.u_location.indexOf("Porvoo sys_id")>-1)
{
arr.push("p4 sys_id");
}
"sys_idIN"+arr.toString();
// replace with your variable names and sys_id's

Hope it helps.

Thanks,
Murthy

View solution in original post

9 REPLIES 9

Hi @Shalika 

Can you please share the screenshot that you have written

Thanks,
Murthy

Shalika_0-1669619978446.png

 

Hi @Shalika 

In the first line after JavaScript replace with :

like below screenshot

MurthyCh_0-1669620205383.png

 

 

 

Thanks,
Murthy

still not working

Hi @Shalika 

While pushing the sys_id's into array in first if condition you should close with double quotes (").

MurthyCh_0-1669621902748.png

 

Thanks,
Murthy