Reports exported to Excel must show Hrs/Min/Seconds (S)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2017 02:05 AM
I have a issue when reports exported to Excel with date/time fields
this is a report
when i export to excel i received:
you can see the difference of date/time fields in both images
Question is how to be able to export the file to excel format and have date/time fields display in Hours/Minutes/Seconds instead of having the spreadsheet display in seconds ? Do you have any approach in script ?
(note: this is not a bug of ServiceNow because this is a design by them )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2017 02:41 AM
It is a known error in servicenow.
As Mohamed said, create a string field, and hide it on the form. Use that field only in reporting.
Follow these next steps:
1.To sync present data write a background script .
2.for future records, write a business rule.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2017 05:22 AM
Hi,
The Actual Elapsed Time field is duration type.
Below are the steps to show elapse time in days format:
Step 1) create a new string field on task_sla
Step 2) write a new business rule on task_sla
Conditions: Actual Elapsed Time changes
Type: before update
Advanced Script:
Step 3) personalize list view by adding new field
Step 4) Right click and export to Excel.
Step 5) Type the below text into the background script window and it will update exiting records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 01:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2022 07:58 AM
Hi Adiseshu,
how can i create new string field on task_sla ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2018 04:18 AM
Try this background script to update records for the last 2 years, bypassing any business rules.
uncomment out ela.update();
var ela = new GlideRecord ('task_sla');
ela.addQuery('u_elapsed_timeISEMPTY^sys_created_onONLast 2 years@javascript:gs.beginningOfLast2Years()@javascript:gs.endOfLast2Years()');
ela.setLimit(40);
ela.query();
while(ela.next())
{
ela.u_elapsed_time=ela.duration.getDisplayValue();
ela.autoSysFields(false);
ela.setWorkflow(false);
ela.setUseEngines(false);
//ela.update();
gs.print('SLA ' + ela.sla.getDisplayValue() + ' task ' + ela.task.number + ' Elapsed ' + ela.u_elapsed_time);
}