Can I change the label of this field?

bonsai
Mega Sage

I would like to change the field label of the yellow marker. How can I do this?
attachedKnowledge_form.JPGattachedKnowledge.JPG

1 ACCEPTED SOLUTION

Bhavya11
Kilo Patron

hi @bonsai ,

 

I will not suggest to do that is OOTB 

in navigation type Formatters, then search 'Attached Knowledge'  then open it. you can see 'View UI Macro for this Formatter' then click on that

Bhavya11_0-1730961249054.png

 

you can see

Bhavya11_1-1730961327268.png

 

 

change this label

${gs.getMessage('Attached knowledges:')}
 
 
then it will appearing like this
 before:
Bhavya11_3-1730961453598.png

 

 
after:
Bhavya11_2-1730961417567.png

 

 

Please mark helpful & correct answer if it's really worthy for you.

 

 

Thanks,

BK

View solution in original post

4 REPLIES 4

Abhay Kumar1
Giga Sage

@bonsai If the field you're referring to is an "Attached Knowledge Formatter" or a formatter element, rather than a standard field from a table, the process for changing the label is different. ServiceNow does not provide a direct configuration option to modify the label of formatters through the UI. However, you can modify the formatter label using a on load client script to manipulate the label at runtime.

 

I will not suggest to do that is OOB but if must please use below code and manipulate dom:

function onLoad() {

    // Replace "knowledge_formatter_id" with the actual DOM ID of the formatter element

    var formatterLabel = document.getElementById('knowledge_formatter_id').getElementsByClassName('label')[0];

    if (formatterLabel) {

        formatterLabel.innerText = 'New Label Text'; // Replace with your desired label

  }

}

Please test the code first in lower instance before implementing on prod.

 

Bhavya11
Kilo Patron

hi @bonsai ,

 

I will not suggest to do that is OOTB 

in navigation type Formatters, then search 'Attached Knowledge'  then open it. you can see 'View UI Macro for this Formatter' then click on that

Bhavya11_0-1730961249054.png

 

you can see

Bhavya11_1-1730961327268.png

 

 

change this label

${gs.getMessage('Attached knowledges:')}
 
 
then it will appearing like this
 before:
Bhavya11_3-1730961453598.png

 

 
after:
Bhavya11_2-1730961417567.png

 

 

Please mark helpful & correct answer if it's really worthy for you.

 

 

Thanks,

BK

SyamPrasanM
Tera Expert

Hello @bonsai 

I Hope this Answere is useful to Your requement

To change the field label of the yellow marker. you need to follow this steps,

Screenshot 2024-11-07 121808.png

 

First step: Right click on Filed label > select Configure label, as shown in the below image

Screenshot 2024-11-07 121808.pngScreenshot 2024-11-07 121924.png

 

step 2 : once click on Configure Label you can edit the label as showen in the below image,

Screenshot 2024-11-07 122132.png

 

Step 3:once edit the label you can click on update button you can see the modified label name as shown in the below image 

Screenshot 2024-11-07 122247.png

follow the above procces you can resolved issue

 

Best Regards

Mule Syam 

PRAVAL-LOGO.png

 

 

 

 

 

 

Thank you for your reply.

The above method is the best way to change the label of a custom field!

For some reason, this operation cannot be performed on the field in question this time.