color a variable

abjaffrey
Giga Guru

Hi 

 

I have a multi row variable se with one variable as yes/no type, it is hidden in portal and a widget script collects the data from portal,

in ritm form if the value is NO it should be highlighted in red, if yes then no change.

 

is it possible, any help

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@abjaffrey 

yes it's possible.

Create catalog client script which Applies to MRVS variable set and Applies on RITM view

Then use this to color the label

but remember it will mark the color if someone opens that row of MRVS on RITM

Output:

color mrvs.gif

Script:

Remember to give correct variable name and no value during comparison

function onLoad() {
    //Type appropriate comment here, and begin script below
    
    if (g_form.getValue('server_os') == 'test') {
        g_form.getControl('server_os').setAttribute('style', 'color:red');
    }

}

It won't highlight it on RITM form. Possibly it would require DOM manipulation which is not recommended

 

AnkurBawiskar_1-1737119843952.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

6 REPLIES 6

@abjaffrey 

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

@abjaffrey 

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