How to filter reference list with a list that starts with a specific word/string?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2015 05:00 AM
Hello,
I have a department form, where there is Employee column( entries are coming from Employee table).
I want to filter these employee who are all have a duty that starts with a specific string. for example "CoOrdinator". (duty is a reference field in employee form that is coming from Duty table).
I tried with a reference qual as javascript:'duty.startswith("CoOrdinator")'. but it is not working.
please advise how to proceed.
- Labels:
-
Scripting and Coding
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2015 05:35 AM
You need something like this
u_duty.{DISPLAY_COLUMN_OF_DUTY_TABLE}STARTSWITHCoOrdinator
Or
u_duty={SYS_ID_OF_CoOrdinator_RECORD}
That is the format of the Ref Qual, anything else will not work. Now you could write a function and return the Ref Qual, something like
javascript:getRefQual()
But the function still has to return the string in the proper format.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2015 06:17 AM
Hi Narenda,
The best way to find the format of the reference qualifier would be to go to your employee table and use the filter to set the correct query and hit run. Then you can right click on the last breadcrumb and choose copy query and that will give you the correct syntax for the query.
Encoded Query Strings - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2015 10:25 PM
Hi Brad,
Thanks for the tip. simple and effective.