After export as Excel time fields are showing seconds but i want to see it in only Hours and Minutes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2023 11:42 PM
Hi,
After export as Excel time fields are showing seconds but i want to see it in only Hours and Minutes.
I want to see in the Excel only Hours and minutes.
Please help me out on the same.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 03:36 AM
Hi @kranthi2
OOTB it is not possible but once you download in excel we can
- To convert time to a number of hours, multiply the time by 24, which is the number of hours in a day.
- To convert time to minutes, multiply the time by 1440, which is the number of minutes in a day (24*60).
- https://www.ablebits.com/office-addins-blog/excel-convert-time-decimal/
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 03:42 AM
I want only HH:MM format is it possible in Excel file.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 03:46 AM
Hi @kranthi2
Yes, but give a try. Search on google , you will get options and it is do able.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 03:49 AM
that's because internally duration field holds value in seconds
Workaround is this: Please discuss with your customer about this as you are creating a custom field on OOB table i.e. task_sla
1) create custom string field on your table (task_sla), make it read-only at dictionary level
2) add this script in the calculated field of that string field
(function calculatedFieldValue(current) {
// Add your code here
var dur = new GlideDuration();
dur.setValue(current.duration);
return dur.getDisplayValue();
})(current);
3) then use this in export
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader