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

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

Hii,

I will writing this in "Selection of needed areas" variable?

And what will be the sys id here - 

"sys_idIN"+arr.toString();

 

Hi @Shalika 

Yes you need to write in the "Selection of needed areas" variable.

Keep it like this. It is a syntax to return the sys_id's no need to change anything in that line.

 

Thanks,
Murthy

It is not working