- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2018 12:24 AM
Hi SNians,
I am working on a Custom table that i have created and wanted to *IMPORT DATA INTO THE DURATION FIELD*
AFAIK Servicenow accepts values in milliseconds. I have duration in excel ranging from 15 mins to 20 days. Understanding this i converted the duration in excel into seconds and wrote a single line code in the transform script
ie "target.duration.setDateNumericValue(*1000);"
I mapped the fields accordingly and ran the transform. For my surprise the all records were empty except 15mins.
I am really not sure where exactly i need to change to get this working. It is quite critical and needs to be moved quickly. I appreciate all you help.
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2018 02:12 AM
Hi Chandhan,
The below link may help you.
https://community.servicenow.com/community?id=community_question&sys_id=594ffa69db58dbc01dcaf3231f961928
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2018 02:00 AM
Hi Chandan,
Can you try using one liner code as below
target.duration.setDateNumericValue(source.u_duration*1000); //Transforms the value in source.u_duration from seconds to milliseconds
Thanks,
Jaspal Singh
Hit Helpful or Correct on the impact of response.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2018 02:12 AM
Hi Chandhan,
The below link may help you.
https://community.servicenow.com/community?id=community_question&sys_id=594ffa69db58dbc01dcaf3231f961928
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2018 05:39 PM
Thanks Archana and Jaspal.. it worked after ,making the code change as
ie "target.u_duration.setDateNumericValue(u_duration*1000);"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2018 05:44 PM
Glad you achieved that.
Please close this thread by marking the helped answer as correct.
Thanks