- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 04:28 AM
Hi All,
I have list of users in excel sheet that needs to be created in sys_user table. Excel sheet(source) is having two fields called 'start date' and 'end date' from those dates the user updated from excel should be marked active true and active false.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 04:59 AM - edited 08-22-2023 05:06 AM
Hello @Jk_ ,
You can achieve this open create a maping which sets target as active field and check the source script field
In the script use the below code snippet:
var gd = new GlideDateTime();
var gd1 = new GlideDateTime(source.u_start_date);
var gd2 = new GlideDateTime(source.u_end_date);
if (gd1<gd && gd<gd2){
return true;
}
else{
return false;
}
Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 04:59 AM - edited 08-22-2023 05:06 AM
Hello @Jk_ ,
You can achieve this open create a maping which sets target as active field and check the source script field
In the script use the below code snippet:
var gd = new GlideDateTime();
var gd1 = new GlideDateTime(source.u_start_date);
var gd2 = new GlideDateTime(source.u_end_date);
if (gd1<gd && gd<gd2){
return true;
}
else{
return false;
}
Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.