I want to create a UI action that allows me to export a list in bulk using multiple layouts and filt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
I am using the following code to bulk export data from an incident table, specifying multiple conditions.
// You need to disable the browser popup blocker
// (otherwise, you won’t be able to download all data)
function onClick() {
// For each layout you want to export,
// set the "filter condition (query)" and "fields to display (fields)"
// Use "Copy query" after applying filters on the list screen to get the query.
// Fields are specified as a comma-separated list.
// You can increase the number of fields as needed.
//
// Example: Configuration to export 3 types of data from the Incident table
var table_name = "incident";
var configs = [{
query: "priority=1^active=true",
fields: "number,short_description,priority,state"
},
{
query: "assigned_toISEMPTY^active=true",
fields: "number,assigned_to,opened_at,category"
},
{
query: "",
fields: "number"
}
];
// Export each configured item in Excel format
configs.forEach(function(cfg) {
var url = "/" + table_name + ".do?EXCEL" +
"&sysparm_query=" + encodeURIComponent(cfg.query) +
"&sysparm_fields=" + cfg.fields;
top.window.open(url);
});
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago - last edited an hour ago
Hi @bonsai
No.
A client-side UI Action using table.do?EXCEL cannot export all records because it always respects ServiceNow export limit properties.
To export all records regardless of properties, you must use a server-side solution, for example a server-side UI Action or Script Include using GlideExport or GlideExcelGenerator in ServiceNow.
Client-side workarounds like sysparm_limit=0 are unreliable and do not bypass hard limits.