How to rename the "Add attachments" to somethings as "Add JSON attachment" in Maintain items on SP?

AbdurRahmanSnow
Giga Guru

Good morning.
I have a requirement. On Service Portal, under a Catalog form (maintain items), we see "Add attachments" button.
I want to rename it to "Add JSON attachment" button. How can we do it?

AbdurRahmanSnow_0-1741068639751.png

 

2 ACCEPTED SOLUTIONS

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @AbdurRahmanSnow 

A very simple point—what value will it drive by making unnecessary changes that could be resolved through user education? Why do you want to increase the system's technical debt?

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

View solution in original post

@AbdurRahmanSnow 

you can use Rich type text or Label and add that message "Please add only JSON attachment"

Then use Attachment variable and use the allowed_extension variable attribute so that they upload only .json file

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

View solution in original post

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

@AbdurRahmanSnow 

I won't recommend doing this even if it's possible.

what's your business requirement?

If you want users to upload json file only then why not use Attachment type variable and use allowed_extension attribute to it?

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

Thank you so much Ankur. Very interesting. Right now, I have added Rich type text and user accepted. Anyhow, really appreciate your reply.

AbdurRahmanSnow_0-1741071078105.png

 



@AbdurRahmanSnow 

you can use Rich type text or Label and add that message "Please add only JSON attachment"

Then use Attachment variable and use the allowed_extension variable attribute so that they upload only .json file

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

Harrymate
Kilo Guru

To rename the Add attachments button to Add JSON attachment:

 

Navigate to  Catalog Definitions > Maintain Items in ServiceNow
Open the Catalog Item where you want to change the button label
Under the Catalog Item form, go to the "Catalog Client Scripts" related list.

Click New to create a new Client Script and enter the following details:

  • Name: Rename Add Attachments
  • UI Type: Mobile / Desktop
  • Type: onLoad
function onLoad() {
    // Wait for the attachment button to be available
    setTimeout(function() {
        var attachBtn = document.querySelector('.attachment-control-label');
        if (attachBtn && attachBtn.innerText === "Add attachments") {
            attachBtn.innerText = "Add JSON attachment";
        }
    }, 1000); // here i made for 1 sec = 1000
}