unable to format 07/24/2020 error in Tranform map
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have two date fields that i am mapping in my Tranform map
the source date field has the following format - mm/dd/yyyy <time> there is no existing date format in ServiceNow that matches that. Also i need it the instance format - yyyy-mm-dd<time>
Is there a way for me to change the format using a script, or will i have to do some manipulation in Notepad++?
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Update the source script of field map to:
answer = (function transformEntry(source) {
var targetDate = (source.u_date.getDisplayValue());
formattedTargetDate = targetRefreshDate.getByFormat("yyyy-mm-dd");
gs.log("SNOW formatted date - " + formattedRefreshDate);
return formattedRefreshDate;
})(source);
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Aren't you able to define the date format or create a new one?
