How do I change the background-color of the Variables container on the RITM/SCTASK form?

itoma
Tera Contributor

Hello everyone,


How could I change the background-color of the Variables container on the RITM/SCTASK form from this gray color to another one? (Example in the attached screenshot).

itoma_0-1742475477173.png

I inspected the page a bit with Chrome DevTools and noticed that this component (or HTML element) is a table and has that gray background color that I would like to change or remove? (example in the screenshot below).

itoma_1-1742476002106.png


Thank you in advance!

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@itoma 

this worked for me, but remember using DOM is not recommended.

function onLoad() {
   //Type appropriate comment here, and begin script below
   var element = document.getElementsByClassName('wide sc_editor');
   element[0].style.background = 'orange';
}

AnkurBawiskar_0-1742478061006.png

Output:

AnkurBawiskar_1-1742478078577.png

 

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

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@itoma 

only way is to use DOM manipulation using onLoad client script.

Ensure Isolate Script = False for your client script for DOM to work

This field if not on form, make it false from list layout

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

Ankur Bawiskar
Tera Patron
Tera Patron

@itoma 

this worked for me, but remember using DOM is not recommended.

function onLoad() {
   //Type appropriate comment here, and begin script below
   var element = document.getElementsByClassName('wide sc_editor');
   element[0].style.background = 'orange';
}

AnkurBawiskar_0-1742478061006.png

Output:

AnkurBawiskar_1-1742478078577.png

 

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

@itoma 

Hope you are doing good.

Did my reply answer your question?

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

itoma
Tera Contributor

Hi @Ankur Bawiskar , thank you for the proposed solution, it worked.