- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2022 07:02 PM
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
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2022 08:35 PM
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.
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2022 08:35 PM
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.
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2022 09:33 PM
Hii,
I will writing this in "Selection of needed areas" variable?
And what will be the sys id here -
"sys_idIN"+arr.toString();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2022 10:38 PM
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.
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2022 10:59 PM
It is not working