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.

need to change text color in workspace

Gillerla Rajesh
Tera Contributor

Hi There,

 

i written script based on condition it will change the color.

it's working in native UI. not in Work space.

 

 

This is the script:

i applied in particular view 

 

g_form.getReference('active_escalation', callback);

    function callback(res) {
        alert("state is" + res.state);
        if (res.state == '100') { //Requested
            alert('state');
            g_form.getControl('number').style.backgroundColor = 'Red';
        } else if (res.state == '101') { //approved
            alert('approved/escalated');
            g_form.getControl('number').style.fontWeight = 'Red';
        }
    }
 happening in Native UI
GillerlaRajesh_0-1738244956805.png

 not heppeing in workspace

GillerlaRajesh_1-1738244978798.png

 

 
 
 

 

 

 

Regards,

Rajesh Gillerla.

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Gillerla Rajesh 

 

I am not 100% sure, but WS and native view are built up on 2 different technologies and it si not easy to make the script work like you are looking for WS. As WS works/builds on UI builder, so please check any possible these otherwise, it si, not possible.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Marco0o1
Tera Sage

Hi @Gillerla Rajesh ,

 

Try creating a Field Styles from the "System UI -> Field Styles" module, two criteria like this:

Marco0o1_0-1738247264906.png

 

Marco0o1_1-1738247273371.png

 

 

 

 

hi @Marco0o1 ,

 

it's not working