- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 10:30 PM
I want to get the row count on Inserted,Created,Updated,total records in transform map.
I have written a script it is not giving me accurate count.Please below ss. Please guide me in this.
var griii4 = new GlideRecord('sys_import_set_run');
griii4.addEncodedQuery('sys_transform_map=04dddc901b04d1502be3dbd1f54bcba4^stateINrunning,complete,complete_with_errors,cancelled,incomplete,cancel_requested^updates=7,223');
griii4.query();
gs.print(griii4.getRowCount());
template.print("<tr><td style='border: 1px solid black;text-align: center; padding: 6px;'>Approvers</td><td style='border: 1px solid black;text-align: center;padding: 5px;'>"+griii4.getRowCount()+"</td><td style='border: 1px solid black;text-align: center;padding: 5px;'>"+griii4.getRowCount()+"</td><td style='border: 1px solid black;text-align: center;padding: 5px;'>"+griii4.getRowCount()+"</td><td style='border: 1px solid black;text-align: center;padding: 5px;'>"+griii4.getRowCount()+"</td></tr>");
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 10:43 PM
instead of getRowCOunt() being passed in all cells, you should be passing
griii4.getValue("total")/griii4.getValue("updates")/griii4.getValue("inserts")/griii4.getValue("ignored")/griii4.getValue("skipped")// check the backend field names
var griii4 = new GlideRecord('sys_import_set_run');
griii4.addEncodedQuery('sys_transform_map=04dddc901b04d1502be3dbd1f54bcba4^stateINrunning,complete,complete_with_errors,cancelled,incomplete,cancel_requested^updates=7,223');
griii4.query();
gs.print(griii4.getRowCount());
template.print("<tr><td style='border: 1px solid black;text-align: center; padding: 6px;'>Approvers</td><td style='border: 1px solid black;text-align: center;padding: 5px;'>"+griii4.getValue("total")+"</td><td style='border: 1px solid black;text-align: center;padding: 5px;'>"+griii4.getValue("insert")+"</td><td style='border: 1px solid black;text-align: center;padding: 5px;'>"+griii4.getValue("ignored")+"</td></tr>");
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2022 10:43 PM
instead of getRowCOunt() being passed in all cells, you should be passing
griii4.getValue("total")/griii4.getValue("updates")/griii4.getValue("inserts")/griii4.getValue("ignored")/griii4.getValue("skipped")// check the backend field names
var griii4 = new GlideRecord('sys_import_set_run');
griii4.addEncodedQuery('sys_transform_map=04dddc901b04d1502be3dbd1f54bcba4^stateINrunning,complete,complete_with_errors,cancelled,incomplete,cancel_requested^updates=7,223');
griii4.query();
gs.print(griii4.getRowCount());
template.print("<tr><td style='border: 1px solid black;text-align: center; padding: 6px;'>Approvers</td><td style='border: 1px solid black;text-align: center;padding: 5px;'>"+griii4.getValue("total")+"</td><td style='border: 1px solid black;text-align: center;padding: 5px;'>"+griii4.getValue("insert")+"</td><td style='border: 1px solid black;text-align: center;padding: 5px;'>"+griii4.getValue("ignored")+"</td></tr>");
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 12:11 AM
I am getting value as null.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 02:20 AM
Hi,
Can you share complete script?
Did you use correct field names?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 02:23 AM
Please share the full script and did you try putting logs there?
Aman Kumar