Why is the date field from my transform map not coming over?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2024 11:55 AM
This is what the data looks like on the transform table for my date field:
The transform is set up as this below. I'm definitely massaging the date so it matches my date format but on the record I'm creating it's not setting the date field at all. Why wouldn't this date be set on a date field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2024 12:41 AM
Hi @e_wilber
I see in your return statement that you are returning 'month-month-day'. You should return the year of the date first, which is the third element (so index 2).
return dateSplit[2] + "-11-" + dateSplit[0];
You can aslo try to use the GlideDate class as described in the documentation if returning a string is not working.
answer = (function transformEntry(source) {
var monthMap = {
"Jan": "01",
"Feb": "02",
"Mar": "03",
"Apr": "04",
"May": "05",
"Jun": "06",
"Jul": "07",
"Aug": "08",
"Sep": "09",
"Oct": "10",
"Nov": "11",
"Dec": "12",
};
var inputDate = source.getValue("u_acquisition_date");
var day = inputDate.split("-")[0];
var month = inputDate.split("-")[1];
var year = inputDate.split("-")[2];
var date = new GlideDate();
date.setValue(year + "-" + monthMap[month] + "-" + day);
return date;
})(source);
Let me know if this works.
Kind regards,
Brian