Dashboards & Reports
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2023 04:21 AM
Hello Community
This is my First time here!
I want to make a report to get latest created record (single record which is created last on table).
I tried script include but its not working for Tokyo Release.
Please suggest me a solution.
Thank You
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2023 06:01 AM
Hi Praveshi ,
Reports in ServiceNow are designed to display multiple records based on various filters and conditions. They are not suitable for displaying a single, specific record, such as the latest incident.
As a work around you can build a custom widget or a ui page to display this and style the page according to your needs
Here is a sample solution using ui page and script include. We have used glide ajax to fetch the data from the table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2023 06:33 AM
Hi @Pravershi ,
Is your script include client callable??, if not create a client callble script include
ex: script include
//script
var inc = new GlideRecord("incident");
inc.addActiveQuery();
inc.setLimmit(1);
inc.orderByDesc("sys_created_on");
inc.query();
if (inc.next()) {
return inc.getValue("number"); //return latest incident number
}
Condition in the report:
javascript: new latestRecord().fetchRecord()
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2023 10:46 AM
Hi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2023 12:53 AM
Hi @Pravershi ,
did you check if the script include works on the actual table???
ex: on the incident table number
and l would also verify if mu script include is triggering (call from client script to validate)
Unfortunately i don't have Tolyo version to verify however its working in Utha, it should work in Tokyo as well.
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025