- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2018 08:36 PM
Hi all,
I have a field type as duration. Field name is "Subscription"
After exporting to excel I'm getting as in milliseconds I hope so.
After transformation again Subscription field values is not updating as it remains empty.
Kindly help. Thanks in advance.
Solved! Go to Solution.
- Labels:
-
User Experience and Design
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2018 08:59 PM
Hi Vikram,
This link might be helpful to you:
https://community.servicenow.com/community?id=community_question&sys_id=0f634b25dbd8dbc01dcaf3231f96198b
Regards
Dhruv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2018 08:59 PM
Hi Vikram,
This link might be helpful to you:
https://community.servicenow.com/community?id=community_question&sys_id=0f634b25dbd8dbc01dcaf3231f96198b
Regards
Dhruv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2018 09:16 PM
Hi Vikram,
If this something which you doing the exports only for the reporting purpose that then converting/exporting to PDF works perfectly fine.
If you are looking for excel specifically, then you may need a string field to hold this date data and then export it to excel. That way time conversation doesn't happen and it keeps the original duration intact.
You can do a workaround like introducing a new field
> The field will calculate the seconds to hours, minutes, seconds through javascript
> You can calculate either by using calculate field in the sys_dictionary OR
> You can write a before BR which triggers everytime actual effort to date changes and calculates and puts inside -
For example, the timestamp of current time returns in milliseconds (in your case the actual effort to date in seconds)
var totalSec = new Date().getTime() / 1000;
var hours = parseInt( totalSec / 3600 ) % 24;
var minutes = parseInt( totalSec / 60 ) % 60;
var seconds = totalSec % 60;
var result = (hours < 10 ? "0" + hours : hours) + "-" + (minutes < 10 ? "0" + minutes : minutes) + "-" + (seconds < 10 ? "0" + seconds : seconds);
Please let us know if the shared info was helpful by marking the response as Helpful.
Feel free to reach out if you have any additional questions.
Best Regards,
Mukul Gupta @ ServiceNow