Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

export limits for scheduled list reports

Casey12
Kilo Expert

Do list reports that get "exported" via a scheduled e-mail respect the export limits in the platform, as defined below?

https://docs.servicenow.com/bundle/madrid-platform-administration/page/administer/exporting-data/con...

For example, if I currently have my CSV Format export row limit set at 250k rows, if this row limit is exceeded in a scheduled e-mail of a list report (in csv format), will the file be truncated?

1 ACCEPTED SOLUTION

Prateek kumar
Mega Sage

Yes it will be.


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

View solution in original post

5 REPLIES 5

thoemu_s
Tera Expert

When I try to access the links to the documentation I get a “404” result.

 

I have tried it with a scheduled job which is executed daily at 9 pm. All incidents that were opened “today” are requested.

When I run this manually, I receive the two messages in the syslog that it has started and finished, but the two recipients (censored here) do not receive any mail.

What is wrong?

If I use the function on the incident list (Export > Excel > Mail) then I receive the mail and the desired attachment. So that works.

 

// Create a new GlideRecord instance
var gr = new GlideRecord('incident');

// Log a message indicating that the job has been started
gs.info('The Scheduled Job has been started');

// Add a query to get only incidents that were opened today
gr.addQuery('opened_at', 'ON', gs.daysAgoStart(0));
gr.query();

// Rest of your script...

// Create a variable to store the CSV data
var csv = '';

// Run through the results of the query
while (gr.next()) {
    // Add the data of each incident to the CSV variable
    csv += gr.number + ',' + gr.short_description + ',' + gr.opened_at + '\n';
}

// Create a new email
var mail = new GlideEmailOutbound();
mail.setSubject('List of incidents opened today');
mail.setBody('Attached you will find a list of the incidents opened today in CSV format');
mail.addTo('Recipient1');
mail.addTo('Recipient 2');

// Add the CSV data as an attachment to the email
mail.addPart(csv, 'text/csv', 'incidents.csv');

// Send the e-mail
mail.send();

// Log a message indicating that the job has been started
gs.info('The scheduled job has finished');