showing particular record in reference list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-15-2023 02:34 AM
Hi , I have created a reference type variable ,which is showing data from a table
but I want to show a particular record in the first row in that reference list , can we do this ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-15-2023 02:36 AM
Yes, you can achieve this in ServiceNow with some scripting. You can create a dynamic filter option for your reference field to manipulate the order of the records.
You'd have to create a scripted filter that changes the order of the records based on your criteria
---------------
Regards,
Rajesh Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-15-2023 02:55 AM
Hi @Amit Dey1 ,
I trust you are doing great.
Yes, it is possible to display a specific record as the first row in a reference list variable in ServiceNow. To achieve this, you can use a GlideRecord query to retrieve the desired record and then manipulate the reference list variable's display value.
Here's an example code snippet that demonstrates how you can accomplish this:
// Assuming your reference variable is called 'my_reference'
var myReference = current.my_reference;
// Querying the table to retrieve the desired record (replace 'table_name' and 'sys_id' with your actual table and record values)
var gr = new GlideRecord('table_name');
gr.get('sys_id', 'desired_record_sys_id');
// Reassigning the display value of the reference variable with the desired record
myReference = gr;
// Now, you can use 'myReference' in your script or UI policy to display the desired record as the first row in the reference list.
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-15-2023 04:15 AM
hi ,
how to use it in client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-03-2024 10:11 AM
Hello experts,
we have a same requirement, the value called as āNo result Foundā should be always show at the end of the result values in the reference field.
please help me asap
looping @Ankur Bawiskar The ServiceNow Career Time-Machine - Chuck Tomasi