How to hide field choice in reference field

RunaliP
Tera Contributor

I have a requirement with respect to Service Catalog. 

 

There are 2 fields - location and Service_and_application, where both are reference fields.

location field referring (cmn_location)table and  Service_and_application(cmdb_ci_service_business)

When we select location as 'Geneva' in location field then 'Work Visa' choice should be hide form service_and_application field.(Eg.when location is 'Geneva' then 'Work Visa' should not be visible).

 

Thank You.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@RunaliP 

you can use advanced ref qualifier on 2nd variable and use this

Ensure you give correct location name and WorkVisa record sysId in below

javascript: var query = ''; if(current.variables.location.name == 'Geneva') query = 'sys_id!=workVisaSysId'; query;

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

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@RunaliP 

you can use advanced ref qualifier on 2nd variable and use this

Ensure you give correct location name and WorkVisa record sysId in below

javascript: var query = ''; if(current.variables.location.name == 'Geneva') query = 'sys_id!=workVisaSysId'; query;

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

Hi Ankur,
It's working.
Thank you so much.

RunaliP
Tera Contributor

javascript: var query = ''; if(current.variables.location.name == 'Geneva') query='sys_id!=8747ac50a371311013c5265765fcdacb';

@RunaliP 

Glad to know that my response is correct.

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