Need to hide add documents button present in employee center in every catalog item .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 10:58 AM
Hi Experts,
I need your help in making "Add Documents" button disabled for a catalog item .
Condition is , when type == value then 'add documents' should be hidden from the emp center catalog frontend page ,but for types it should be visible .
Added the image of the button and html format .
It's little urgent, will be glad having any help.
Below is the code for hiding the button which i tried but didn't worked:
"function hideAttachmentButton() {
var attachmentButton = this.document.getElementsByClassName('attachment-text');
alert(attachmentButton);
attachmentButton.style.display = 'none';
}
}"
object value is getting alert too but button is not hiding.
Any help will be appreciated. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 08:14 PM
Hi @Shivangi Singh2 ,
Use ng-if or ng-show (Recommended for ServiceNow UI)
Since Employee Center uses AngularJS, the cleanest way is to modify the widget’s HTML to conditionally hide the button.
<span ng-if="c.data.type != 'value_to_hide'" ng-class="{'attachment-text': options.native_mobile == 'true'}" aria-hidden="true"> Attach documents </span>
Replace value_to_hide with the catalog item type where the button should disappear.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2025 01:07 AM
Hi Tejas,
Can you provide the code in client script format instead of portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 09:11 PM
this is for which portal page? share complete screenshots.
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