Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Rich Text Label not updating in RITM (Variable Editor) but works in Service Portal

Ankit Balapure
Tera Contributor

Hi,

I’m facing an issue with dynamically updating a Rich Text Label in RITM and SC Task forms.

I am using the g_form.setLabelOf() method to update the label text dynamically. It works as expected in the Service Portal, but it is not working at the RITM and SC Task level in the platform UI.

Also, I would like to avoid any DOM manipulation-based solution, as DOM manipulation is not used or supported in our organization.

Could anyone please suggest if there is any supported or recommended solution for this scenario?

Thanks.

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@Ankit Balapure 

see this

g_form.setLabel does not work on a Label type variable on Service Portal 

💡 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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Ankit Balapure
Tera Contributor

Hi @Ankur Bawiskar,

I’m not sure this addresses my question.

To clarify, I have a variable of Rich Text type, and I am using the setLabelOf() method to dynamically set its content. This is working correctly in the Service Portal, but it is not working at the RITM and SC Task level in the Platform UI.

In your response, you mentioned using the setLabel() function, but my requirement is specifically related to updating Rich Text content dynamically, not just a plain label.

Could you please suggest the correct or supported approach for achieving this in RITM/SC Task without using DOM manipulation?

Thanks.

jcmings
ServiceNow Employee

How have you configured this in the service portal? Via a catalog client script/UI policy? Did you also create a onLoad client script on RITM table and on SC Task table?