Transform map scripting date validation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2022 12:35 AM
in source table start date type is date/time and in target table start date type is only date now when i load the date with transform map excel sheet in excel if i put 02/03/2022 i target it coming as 01/03/2022 beacuase of time i need to ignore the time in script and just need to take date above script is written its not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2022 12:52 AM
I think there is a code error as in your else part of script you need to set answer as answer = dateTime[0];
You are setting answer as split and not the 1st element after split.
it should be var date = u_source_start_date.split('');
answer = date[0];
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2022 01:59 AM
still not working start date is not coming
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2022 02:22 AM
Hi Veena ,
Comment the line: answer = '';
var startDate = new GlideDate();
if(source.u_start_date =''){
gs.log('Enter);
gs.log("Source Date :" +source.u_start_date);
answer = startDate ; if this doesnt work
try this as well
target.backened_name of the target _start date = startDate;
gs.log("Target Date :" +target.start_date); // Check the your target field name;
}
else {
var date = [];
// get the value of the source date in one variable.
var sourcedate = source.u_startdate;
date = sourcedate.split(' ');
check what value are you getting using gs.log('Answer: +answer + 'Date :' + date[0] + 'Source Date: '+sourcedate ) ;
answer = date[0]; OR target.source_date = date[0];
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2022 12:53 AM
Hi ,
Try using the Code