Hide logged in user to appear on requested for variable for certain catalog item

Sam198
Mega Guru

Hi

I have requested_for variable on the variable set that is used on various catalog items, I want to hide the logged in user as user selection on the requested_for field only for certain catalog item. I understand i can use the reference qualifier condition on the requested_for variable as "sys_id does not contain javascript:gs.getUserID();" - but this will mean it will hide logged in user for all catalog item where this variable set is used, which is not the requirement - As, i only want this to happen on certain catalog items and not all. How can i do this with a client script on the variable set for just this catalog items?

 

1 ACCEPTED SOLUTION

Hi Sam,

Refer - https://community.servicenow.com/community?id=community_question&sys_id=34c6cf65db1cdbc01dcaf3231f96199d

View solution in original post

7 REPLIES 7

Tudor
Tera Guru

Hello Sam,

My suggestion would be to have an additional variable set that is used for this sole purpose.

In the long term, administration point of view, it will be much easier to work with two, rather than figuring out a very complicated solution that will be difficult to maintain.

Tudor

Aman Kumar S
Kilo Patron

You will have to rely on the reference qualifier only.

But did you try if you can leverage advanced ref using script include and try and access catalog item in the script and then return the query 

Best Regards
Aman Kumar

Hi Aman,

Thanks for pointing out, i think the dynamic or advanced ref using script include might be the way, Do you have any sample script or reference to any post seen before that i can use?

 

Thanks.

dmathur09
Kilo Sage
Kilo Sage

Hi Sam,

You can explore dynamic reference qualifier and can script the whole thing in script include and pass it to the dynamic reference qualifier.

Regards,

Deepankar Mathur