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.

Customizing Icon in the Change form

H M Aishwarya1
Tera Guru

Hi,

 

I was trying to update the icon info based on state changes:

 

For Ex: In the description field i wanted to show help icon with some text 'abc' when state is 'New'

 And For the same description field i wanted to show help icon with some text 'xyz' when state is 'Assess'

 

Here I am facing the issue that i am not able to clear the first help icon text when the state is changed its showing both, Please refer the attachment.

 

Any Suggestions would helpful

 

Thank You!

 

 

1 ACCEPTED SOLUTION

@H M Aishwarya1 

just after your onChange triggers remove the decoration so that the new icon is shown with proper text

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }

g_form.removeDecoration('description', 'icon-view', 'Your Title here');

// your logic here

}

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

@H M Aishwarya1 

how are you showing that icon? share the script and script config screenshots.

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

I am using onLoad CS and one onChange of State

 

HMAishwarya1_0-1745848318781.png

 

HMAishwarya1_1-1745848411540.png

 

 

@H M Aishwarya1 

just after your onChange triggers remove the decoration so that the new icon is shown with proper text

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }

g_form.removeDecoration('description', 'icon-view', 'Your Title here');

// your logic here

}

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

Hi Ankur,

 

It worked for me, Thank you for the quick response.