Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

When select custom date in table form i should get the count of the exact date updated record count

TEJAS
Tera Contributor

Hi All ,

Hi all,

I’ve built a form in ServiceNow that allows users to:

  1. Select a table (e.g., incident).

  2. Choose a "Last Updated Earlier Than" value — options include predefined ranges like "yesterday", "last week", or a "custom date".

  3. If "custom date" is selected, a date picker shows up, and users can choose a specific date.

Here’s the goal:

    • A Script Include (getPurgeRecordCount) that returns the count using GlideRecord.

    • A GlideAjax call from the client script that passes the selected table and date.

    • When "custom date" is selected, I pass that date to the Script Include as a parameter (select_date)

       

      My question:

      How can I modify the Script Include so that it filters only the Updated records on the selected custom date.

      When users select a custom date (e.g., April 3), I want the updated record count on that date and  selected table (incident) .

      Right now, even when I select a custom date, the record count returned includes all records from the table

 

 

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@TEJAS  

So what's the question?

OR

Is this an informative article?

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

question:

How can I modify the Script Include so that it filters only the Updated records on the selected custom date

Now I am able to get all record when I select custom date but I need selected date updated record only