Glide Record - Query records older than N days - Pull 1#2363
Closed
hanna-g-sn wants to merge 2 commits intoServiceNowDevProgram:mainfrom
Closed
Glide Record - Query records older than N days - Pull 1#2363hanna-g-sn wants to merge 2 commits intoServiceNowDevProgram:mainfrom
hanna-g-sn wants to merge 2 commits intoServiceNowDevProgram:mainfrom
Conversation
This README provides a guide on querying records older than a specified number of days using GlideRecord in ServiceNow. It includes details on the solution, usage context, implementation steps, and references to relevant APIs.
This script retrieves records from the 'incident' table that are older than 30 days based on the 'opened_at' field. It limits the output to 200 records and provides a count of the retrieved records.
Contributor
ravichandra1998g
left a comment
There was a problem hiding this comment.
Hello @hanna-g-sn
We appreciate the effort you’ve put into this contribution.
For Hacktoberfest, we’re aiming for high-quality contributions providing real-world use developer cases. You can see some of the recently merged PRs to know the kind of code snippets we are aiming for.
This cannot be merged as the code snippet is basic Gliderecord query to get records along with GlideDateTime filter.
Please do not submit low effort PRs.
Please reopen/ submit a new one after adding more dynamic context/use cases that are more suitable for the Hactoberfest!
Thank you!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description:
This submission demonstrates an efficient use of GlideRecord, GlideDateTime, and GlideSystem to find and process records older than a configurable threshold (N days) without heavy queries.
Use case:
Identify and act on aged records (for example, Incidents older than 30 days) in a performance-safe way.
Key features:
Includes:
Tested in:
Zurich release instance on
incidenttable with 5k records. Verified count output and date filter accuracy.Pull Request Checklist
Overview
Code Quality
Repository Structure Compliance
Core ServiceNow APIs/Server-Side Components/Client-Side Components/Modern Development/Integration/Specialized Areas/Documentation
Restrictions