How can I hide quantity on open activities

NikolaTesla
Tera Expert

 

I’m trying to hide the "Quantity" field that appears on each task card in the "Open Activities" section of the Employee Service Center (ESC).

I've inspected the widget and found that the field is rendered using:

I would like to either:

  • Completely remove this field from the task cards, or

  • Hide it conditionally, if possible (e.g., based on catalog item or some logic).

Here’s a screenshot for context:

NikolaTesla_0-1747853980387.jpeg

 

Can anyone guide me on the best way to hide this field without affecting other functionality?

 

Thanks in advance!

1 ACCEPTED SOLUTION

James Chun
Kilo Patron

Hi @NikolaTesla,

 

Navigate to Employee Center > Administration > To-dos Configuration.

By the looks of your screenshot, the tasks look like approval records, so filter the 'Table' column with the value of sysapproval_approver.

The configuration is most likely to be in the 'Approvals' record, open the record.

In the 'Details row' tab, modify the 'Detail fields' to remove the quantity field.

JamesChun_0-1747881699604.png

 

Cheers

 

View solution in original post

5 REPLIES 5

James Chun
Kilo Patron

Hi @NikolaTesla,

 

Navigate to Employee Center > Administration > To-dos Configuration.

By the looks of your screenshot, the tasks look like approval records, so filter the 'Table' column with the value of sysapproval_approver.

The configuration is most likely to be in the 'Approvals' record, open the record.

In the 'Details row' tab, modify the 'Detail fields' to remove the quantity field.

JamesChun_0-1747881699604.png

 

Cheers

 

SuyashJ41731830
Tera Contributor

Hi 
@NikolaTesla 

 

Step 1: Clone the Widget (Best Practice)

Do not modify out-of-box (OOB) widgets directly.

  • Navigate to Service Portal > Widgets

  • Find the widget responsible for rendering the task cards (e.g., something like sc_task_card, sp_task_card, or a custom widget)

  • Clone the widget

Step 2: Edit the HTML Template

Find the section that looks like this (example):

 

html
<div class="quantity"> {{data.quantity}} </div>

Or sometimes:

 

html
<span ng-if="data.quantity">{{data.quantity}}</span>

Step 3: Remove or Comment It Out

Just delete or comment that section:

 

html
<!-- <div class="quantity"> {{data.quantity}} </div> -->

Hide Conditionally (e.g., Based on Catalog Item)

Step 1: Modify Server Script

In the Server Script of the widget, determine the condition under which the "Quantity" field should be hidden. For example:

 

javascript
if (input.sys_id) { var task = new GlideRecord('sc_task'); if (task.get(input.sys_id)) { data.catalog_item = task.request_item.cat_item.name; data.show_quantity = (data.catalog_item != 'My Special Item'); // hide if this item } }

Step 2: Update Client Template (HTML)

Wrap the quantity field in a conditional:

 

html
<div class="quantity" ng-if="data.show_quantity"> {{data.quantity}} </div>

If you can’t edit the widget and need a quick fix:

Use CSS:

You can hide it via portal theme or embedded CSS (not ideal long-term):

 

css
.task-card .quantity { display: none; }

Or, scoped with additional logic using ng-class or a custom ng-if.


Best Practice Tip

If this widget is reused in multiple places and you only want to hide "Quantity" in the ESC "Open Activities" section, try to:

  • Detect the portal/page in the widget (e.g., if ($sp.getPortal().url == 'esc'))

  • Or detect context/page ID and pass it to the widget as a parameter


    If my response helped please mark it correct
    Thanks, and Regards,
    Suyash

Ankur Bawiskar
Tera Patron
Tera Patron

@NikolaTesla 

which page is that?

Did you check which widget is being used?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

SumanthDosapati
Mega Sage
Mega Sage

@NikolaTesla 

Which widget is that?

Ctrl+Right click on that widget and click on 'Show widget customizations' to see the widget name

 

Regards,
Sumanth