Service Catalog Reference Qualifier: Filter Based on Requested For?

PrathmeshT
Tera Contributor

Hi all,

 

I am working on a Service Catalog item where I need to filter the Computer Name reference field. The requirement is to display only computers where:

 

Assigned To = Requested For

 

OR Last Logged In User = Requested For

What will be the reference qualifier for this?

4 REPLIES 4

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @PrathmeshT 

https://www.servicenow.com/community/developer-forum/select-user-and-list-assets-assigned-catalog-fo...

 

https://www.servicenow.com/community/developer-forum/populate-logged-in-user-details-in-catalog-item...

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron
Tera Patron

@PrathmeshT 

assuming Requested for is already a variable on your form then use this

Note: give correct variable name and correct field name for last logged in user

javascript: 'assigned_to=' + current.variables.requestedForVariable + '^ORlast_loggedin_user=' + current.variables.requestedForVariable;

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@PrathmeshT 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

JenniferRah
Mega Sage

Without knowing which table you are referencing in the Computer Name variable, it's hard to say. I will assume it's the alm_hardware table and that "Last Logged In User" is a custom field. I will also assume your Requested For is a variable. 

 

In these cases, you would set your reference qualifier to be this:

javascript: "assigned_to=" + current.variables.requested_for + "^ORu_last_logged_in_user=" + current.variables.requested_for;