- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2022 02:42 AM
I am importing Data from excel using import set. While importing I have Date field in excel which has format dd/mm/yyyy tt:mm. but I want to import only dd/mm/yyyy and not tt/mm. How to achieve that without editing excel in servicenow and without configuring dictonary.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2022 02:58 AM
Hi,
You can try this script in transform map scripts -
var excel_date = source.u_date_field.toString();
var today = new GlideDateTime(excel_date);
target.u_date = today.getDate();
Feel free to mark helpful & correct!
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2022 02:55 AM
If you set the 'date format' field on the field mapping correctly (as it is in excel), it should transfer to your date field without any issue.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2022 02:58 AM
Hi,
You can try this script in transform map scripts -
var excel_date = source.u_date_field.toString();
var today = new GlideDateTime(excel_date);
target.u_date = today.getDate();
Feel free to mark helpful & correct!
Thanks,
Sagar Pagar