I created an script inc to get data from a table in a report, but seems this include is inefficient
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2024 08:38 AM
Hello everybody.
I created an include script to get data from the sys_uyser_grmember table into a report, however apparently this include is inefficient, and taking a long time to load the data, which is causing servicenow to not load my report. I would like your help to know if there is anything I can do in my code to help make my report load faster and more efficient?
here is the include
And this is how my report is appearing to me due the loading being to slow
I Cannot even edit the report
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2024 09:46 AM - edited ‎03-04-2024 09:46 AM
Hello @Erlan01 ,
Have you run the script in the background? If not, try running it in the background while keeping some logs.
Convert sys_id to string at line 36 by using userMember.push(grMember.sys_id.toString()). Additionally, the userMember variable is of type Array; I'm not sure why you're splitting it into string again by using ',' character. Instead just return userMember.
Regards,
Sasikanth
If my solution addresses your issue , Please mark it as Helpful