List Collector dynamic reference qualifier for catalog item

Michael M1
Giga Expert

I have a list collector variable on the sys_user table in a catalog item and I want to update the filter on the collector based on a selection of a drop down on the catalog item. I can do this as a catalog client script but I am having trouble setting the encoded query.

I want to encode 2 things

- show only users whose manager is the current user (i.e. requestor).

- The requestor chooses expires in 30, 60, or 90 days from a drop down list. I need to show users that have u_expires date field less than 30/60/90 days from now.

Thanks

1 ACCEPTED SOLUTION

Jim Coyne
Kilo Patron

OK, actually, we should be able to accomplish this without a Client Script:

1. set the Reference qualifier for the List Collector to the following:

javascript:"active=true^u_user_type=Consultant^manager=" + gs.getUserID() + "^u_expiresRELATIVELT@dayofweek@ahead@" + current.variables.number_of_days;

2. set the "Variable attributes" field for the List Collector to the following:

ref_qual_elements=number_of_days

The "ref_qual_elements" attribute will send back to the server the current values for those variables so they can be used in the reference qualifier.

Replace "number_of_days" in both the Reference qualifier and the "Variable attributes" field with whatever your variable name is.

I tried it in my dev instance with "Company" and "Users" variables and the Users list collector changes based on the selected company.  In both the regular and portal UIs.

View solution in original post

11 REPLIES 11

Hi Jim,

Can you please tell me what should I do if need to get only users who belong to the company of the currently logged in user.

Thanks in advance.

Did you ever figure this out?