How to filter reference list with a list that starts with a specific word/string?

narendrareddy
Kilo Explorer

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.

3 REPLIES 3

DrewW
Mega Sage
Mega Sage

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.





Brad Tilton
ServiceNow Employee
ServiceNow Employee

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


Hi Brad,


Thanks for the tip. simple and effective.