Report function to return NAME of day of week
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2024 09:30 PM
Hi there, I am trying to return the day of week (the name, not an integer) in a report. Does anyone know how to do this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 06:33 AM
if you are using the 'Column' visualization report you can use Day instead of Date in the Calendar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 08:57 AM
Hi @Nadia Ebrahim ,
Try to use this in script include (or) create custom field and populate day using below script:
var todayDateTime = new GlideDateTime(gs.nowDateTime());
var integerValForToday = todayDateTime.getDayOfWeekLocalTime();
var jsonObj = '{"1":"Monday","2":"Tuesday","3":"Wednesday","4":"Thursday","5":"Friday","6":"Saturday","7":"Sunday"}';
var parser = new JSONParser();
var parsedData = parser.parse(jsonObj);
var dayOfWeek = parsedData[integerValForToday];
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 11:11 PM