How to fetch all the records for table and provide to analyze in Now Assist Skill Kit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I want to fetch all the records of a particular table rather than a single record of a particular table to provide as an input in script to analyze, is it possible or any alternative, if not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @VaibhavP5059517 ,
You can use GlideRecord / GlideAggregate for a particular table, but the challenge is the if that table has millions of data, it will impact the Performance and can timeout while querying.
What i did was, Exported the data in a Excel sheet and then analyzed what is need.
Sandeep Dutta
Please mark the answer correct & Helpful, if i could help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
GlideRecord() with query(addQuery() or addEncodedQuery()) & using 'while' loop will return all the records from the table which you are querying dependent upon the query being matched
Sample Server-Side Script Example (GlideRecord)
Here is a common approach to retrieve all records and their data:
var tableName = 'incident'; // Replace 'incident' with your table name
var gr = new GlideRecord(tableName);// No addQuery() or addEncodedQuery() means it will fetch all recordsgr.query();
// Create an array to store the data
var recordsList = [];while (gr.next()) {
var recordData = {};
// Get specific field values and add them to the object
recordData.number = gr.getValue('number');
recordData.short_description = gr.getValue('short_description');
recordData.assigned_to_display = gr.getDisplayValue('assigned_to');
// Add more fields as needed recordsList.push(recordData);
}gs.info("Total records fetched: " + recordsList.length);- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello @VaibhavP5059517 ,
You can directly add a prompt for this in prompt editor - now assit skill kit :
If my response helped mark as helpful and accept the solution.
