Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

setLabelOf() does not work on an RITM

Akshay Bhaskar
Kilo Sage

I've been working on some form changes, and I've realised that while you can manipulate the label of a field within a catalog form using the setLabelOf(), the same onLoad script would not work on the RITM, and this is my experience currently. 

Could you please validate if I'm missing something here - I have a field in a catalog form called 'directorships'. The label of the field is 'Mention the Directorships', and I'm using an onLoad client script to change the label of this field to 'Hello. This is the directorships label.' Whilst the latter label is displayed as expected on the portal, the submitted RITM still shows the old label. 

@Ankur Bawiskar

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Akshay Bhaskar 

then it means it's not working in backend view i.e. on RITM form

you might have to use DOM manipulation for this

Note: DOM manipulation is not recommended

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Sarthak Kashyap
Mega Sage