- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2020 09:46 AM
Hi All,
As the title states, on my import set table i have 3 string fields that are filled with a date, time, and timezone. The format looks like this and ServiceNow does not like the format, the import errors out,
var a = source.u_event_date.slice(0, 19);
var b = source.u_create_date.slice(0, 19);
var c = source.u_effective_date.slice(0, 19);
var evd = a.replace("T", "");
var efd = b.replace("T", "");
var cd = c.replace("T", "");
target.u_event_date = evd;
target.u_effective_date = efd;
target.u_create_date = cd;
})(source, map, log, target);
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2020 09:50 AM
Can you try using replace in below format,
var evd = a.replace(/T/g, '');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2020 10:37 AM
ive done it this way
var evd = a.replace("/T/g", "");
var efd = b.replace("/T/g", "");
var cd = c.replace("/T/g", "");
ive done it this way:
var evd = a.replace(/T/g, "");
var efd = b.replace(/T/g, "");
var cd = c.replace(/T/g, "");
still errors out

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2020 10:42 AM
One with quotes anyways wont work.
var evd = a.replace(/T/g, ' ');//Needs a space in between
var efd = b.replace(/T/g, ' ');
var cd = c.replace(/T/g, ' ');
Better print the result in logs. See the difference & then transform it.