Change CSV separator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2025 03:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2025 05:01 AM
Short answer: you can’t change the CSV delimiter OOB for either List → Export > CSV or Export Set.
The property you tried (glide.ui.glide_list.separator) affects UI list rendering, not file exports—so it won’t change the delimiter in exported CSVs. ServiceNow’s CSV export is hard-coded to comma. Community threads and docs confirm there’s no native setting to switch to ; or | for exports or Export Sets.
That said, there are clean workarounds. Pick one:
Option A — Generate your own delimited file (recommended)
Create a Scripted REST API or scheduled job that builds the file with your delimiter (; or |) and attaches it, or drops it via MID/SFTP.
Skeleton (server-side):
(function createDelimitedAttachment() {
var table = 'incident';
var fields = ['number','short_description','priority','state'];
var DELIM = ';'; // change to '|'
function esc(v) {
if (v == null) return '';
v = v + '';
// Quote if contains delimiter, quote or newline
if (v.indexOf(DELIM) > -1 || v.indexOf('"') > -1 || /\r|\n/.test(v)) {
v = '"' + v.replace(/"/g, '""') + '"';
}
return v;
}
var out = [];
out.push(fields.join(DELIM)); // header
var gr = new GlideRecord(table);
gr.addActiveQuery();
gr.setLimit(10000);
gr.query();
while (gr.next()) {
var row = fields.map(function(f){ return esc(gr.getDisplayValue(f) || gr.getValue(f)); });
out.push(row.join(DELIM));
}
var content = out.join('\r\n');
// Attach to a sys_export_set or any record you prefer
var bytes = new Packages.java.lang.String(content, "UTF-8").getBytes("UTF-8");
gs.getSession().putClientData('custom_export_name','export_' + new GlideDateTime().getNumericValue() + '.csv');
var attSysId = new GlideSysAttachment().write('sys_user', gs.getUserID(), 'custom_export.csv', 'text/csv', bytes);
gs.info('Custom CSV created: ' + attSysId);
})();
Use as a Scheduled Script, Fix script, or behind a Scripted REST to download directly.
If you need SFTP via MID, write to disk in an Orchestration/MID step then transfer.
Option B — Use
Report → Export
but post-process
Export as CSV (comma) from a saved Report and transform the delimiter server-side (Flow Designer action or BR that reads the attachment, swaps commas → semicolons with proper quoting, then writes a new file). Still custom, but simple.
Option C — Export
XLSX
instead of CSV
If the consumer is Excel, export Excel (.xlsx) from lists/reports. XLSX avoids locale/comma/decimal issues altogether. (Note: not useful if the downstream system demands delimited text.)
Option D — Leverage
Data Extraction via IntegrationHub
Build an IH action that queries data and emits a text payload with your delimiter, then:
uploads it as an attachment (Attachment API), or
sends it via MID/SFTP or HTTP to the target system.
Notes & pitfalls
Decimal / locale: CSV exports normalize decimals to dot; if you require , as decimal, stick to XLSX or control formatting in your custom generator.
Export Set: there’s no delimiter setting on sys_export_set (unlike CSV import on Data Sources). You must generate the text yourself if you need ;/|.
Quoting rules: Always escape " as "" and quote fields containing delimiter/newlines.
