Duration Variable and Field Display - Removing Hours and Seconds

dmullinax
Mega Guru

I want to further customize the duration field in the Service Center "Portal" as well as the NOW Platform back-end field.

Out of the box, the duration variable and field type has four columns, Day, Hours, Minutes and Seconds.

find_real_file.png

I discovered how to remove the Days column in this article: "Duration Field Display" using the max_unit=hours attribute.
https://community.servicenow.com/community?id=community_question&sys_id=a92ee7eddb57abc02e8c2183ca96...

Looks good so far.  Here's what I got so far.
find_real_file.png

Business owner wants me to remove minute and seconds.  The article doesn't explain how to remove those columns.

This article explains how to set max_unit, but doesn't explain how to remove the preceding columns.

https://docs.servicenow.com/bundle/quebec-employee-service-management/page/product/service-catalog-m...

How do I configure the duration field variable to only show Hours?

Variable:
find_real_file.png

Field Dictionary:
find_real_file.png

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

Hi @dmullinax 

Found something in the post, but this is not really a good idea, since it will require DOM manipulation which is not recommended. you can only set max_unit and not minimum unit.

Show Hours Only in Duration

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

 

Best Regards
Aman Kumar

View solution in original post

1 REPLY 1

Aman Kumar S
Kilo Patron

Hi @dmullinax 

Found something in the post, but this is not really a good idea, since it will require DOM manipulation which is not recommended. you can only set max_unit and not minimum unit.

Show Hours Only in Duration

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

 

Best Regards
Aman Kumar