Remove all value from reference field

Omkarbh1997
Tera Expert

Hi,

Requirement:- When user select "Purpose" field as 'Automotive build-up' then above "Select OUC" all value should be clear and only shown some specific 6 records from that table after click on magnify glass icon, there is already configure Reference Qualifier query. below ss are available for reference.

Screenshot (23)_LI.jpg

 

existing query on reference qualifier.

Omkarbh1997_0-1737012097146.png

 

Thank You.

 

1 ACCEPTED SOLUTION

@Omkarbh1997 

As per my understanding you want to display the existing query and if the purpose field is automotive build up then you want to add some other query.

If that's the case then modify the reference qualifier by adding the existing query as shown below.

javascipt:current.variables.purpose == "sys_id_of_automotive_build_up" ? "add encoded query": "add existing encoded query";

Hope this helps!

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

 

Thank You
Juhi Poddar

View solution in original post

9 REPLIES 9

@Omkarbh1997 

As per my understanding you want to display the existing query and if the purpose field is automotive build up then you want to add some other query.

If that's the case then modify the reference qualifier by adding the existing query as shown below.

javascipt:current.variables.purpose == "sys_id_of_automotive_build_up" ? "add encoded query": "add existing encoded query";

Hope this helps!

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

 

Thank You
Juhi Poddar

@Juhi Poddar 
It's working.

Thank You

@Omkarbh1997 

Glad that your query is resolved.

 

@Omkarbh1997 

Kindly mark the response as an accepted solution. This helps future readers to locate the solution easily in community.

 

Thank You 

Juhi Poddar 

Ankur Bawiskar
Tera Patron
Tera Patron

@Omkarbh1997 

you will have to enhance the advanced ref qualifier

Note:

1) give correct variable name and choice value for automotive

2) give the correct existingfilter (you can form this filter condition on your table list and copy it from there)

3) give the correct sysIds of those 6 records

 

javascript: var query = 'yourExistingFilter'; if(current.variables.purpose == 'automotiveValue') query = query + '^sys_idINsysId1,sysId2,sysId3,sysId4,sysId5,sysId6'; 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