can I change the label for the variable formatter name that shows up on a form?

tricial
Giga Contributor

I need to change the name that shows up on the form for the Varaible editor formatter so instead of displaying

Varaibles, I need to label that to be Work Actions or something other than variables.

Thank you

Tricia

1 ACCEPTED SOLUTION

Next step is to check your browser console and see if there are any errors.   There could be another script preventing this one from running.   You can also test in the Javascript executor (press CTRL+ALT+SHIFT+J) while viewing the 'sc_task' form where the variable editor is and paste in everything inside of the 'onLoad' function.


View solution in original post

17 REPLIES 17

Venkateswarlu K
Mega Guru

Hi


Tricia


can u please go through the following links that will helpful to u



ServiceNow KB: Determining whether the Variable Editor is added to a form (KB0538897)


Can I put the Variable Editor on a new table extended from the Task table?


Please mark as a correct or mark as a helpful   if it is useful


                        Thanks&Regards,


                        Venkateswarlu Kuruva


This Label that Says Variables.


It is the Formatter Variable Editor


I want to change the name that is presented on the form so instead of the user seeing the wording "Variables"


It has a different label (Work or anything else besides the name Variables.



Thank you


Tricia


Not sure if the ui macro is setting this


I could not find a way to set the label








<https://htmlsig.com/t/000001C0XZNW>


Patricia Lynch / ServiceNow Senior Technical Consultant 
patricia.lynch@cdillc.com<mailto:patricia.lynch@cdillc.com>


CDI LLC 
O +1 (201) 426-9264
M +1 (201) 397-3766


696 US 46 West, Teterboro, NJ 07608 
www.cdillc.com<http://www.cdillc.com/>


<https://htmlsig.com/t/000001C4DJ2F>[cid:image005.png@01D28E83.740D62E0]<https://htmlsig.com/t/000001C8HE8S>[cid:image006.png@01D28E83.740D62E0]<https://htmlsig.com/t/000001C6Q638>[cid:image007.png@01D28E83.740D62E0]<https://htmlsig.com/t/000001C95K6C>


Mark Stanger
Giga Sage

2 ways...



1)   Navigate to 'System UI -> Messages'.   Create a new record where the 'Key' value is 'Variables' and the 'Message' value is 'Work Actions'.   This is a GLOBAL change, which means this label will apply wherever variables are displayed on a back-end form.   This includes request items, catalog tasks, change requests, incidents, and anywhere else that you use a record producer.   This is definitely simpler and less risky but has a pretty wide-ranging impact that may not be desirable in all locations.



2)   Create a new 'OnLoad' client script on whatever table you want to change the label for and include this code within the 'onLoad' function.



try{


      $$('.veditor_header')[0].innerHTML = 'Work Actions';


}catch(e){}



The benefit of this approach is that you can target the change to apply just to the specific places you need it.   The downside is that it's dom manipulation (and therefore more likely to break during a future upgrade).


Thanks Mark,



I opted for the Client script


However, it still does not change the name.



This is on the Catalog Task table I am trying to set it on.




function onLoad() {


try{


$$('.veditor_header')[0].innerHTML = 'Work Actions';


}catch(e){}


}




<https://htmlsig.com/t/000001C0XZNW>


Patricia Lynch / ServiceNow Senior Technical Consultant 
patricia.lynch@cdillc.com<mailto:patricia.lynch@cdillc.com>


CDI LLC 
O +1 (201) 426-9264
M +1 (201) 397-3766


696 US 46 West, Teterboro, NJ 07608 
www.cdillc.com<http://www.cdillc.com/>


<https://htmlsig.com/t/000001C4DJ2F>[cid:image004.png@01D28E86.9FE088E0]<https://htmlsig.com/t/000001C8HE8S>[cid:image005.png@01D28E86.9FE088E0]<https://htmlsig.com/t/000001C6Q638>[cid:image006.png@01D28E86.9FE088E0]<https://htmlsig.com/t/000001C95K6C>