How to add icon in field control

guru_elearn
Kilo Expert

Hi,

I have to add an Help icon to each field on condition. Could you please let me know the procedure / steps to do this?

Thanks

Guru

1 ACCEPTED SOLUTION

Geoffrey2
ServiceNow Employee
ServiceNow Employee

It sounds like you need field_decorations (or ref_contributions), an attribute on the field that displays a UI Macro after the field.


See http://wiki.servicenow.com/index.php?title=Dictionary_Attributes#gsc.tab=0



Assume you want to add a help icon to the CI field ion an Incident when the Xfire CI is selected.


Find an icon image and add it to the Image gallery


Screen Shot 2016-08-31 at 9.55.08 PM.png



Create a UI Macro


Your condition for showing the icon is in the evaluate script here.


Screen Shot 2016-08-31 at 9.56.13 PM.png



Update the Attributes on the field in the Dictionary:


Screen Shot 2016-08-31 at 9.58.58 PM.png


Each attribute is separated by commas, and each value for one attribute is separated by semi-colons.



Please note that ref_contributions/field_decorations do not work on all field types.



The result is this


Screen Shot 2016-08-31 at 10.02.33 PM.png


Screen Shot 2016-08-31 at 10.02.48 PM.png


The icon will show when you save the form. You can use a Client Script to show it as soon as the field is changed.


View solution in original post

6 REPLIES 6

Deepa Srivastav
Kilo Sage

Below link might help you.



Field Label Help - ServiceNow Wiki


Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.


HI deepa,


Can u please checkattribute for image once


Geoffrey2
ServiceNow Employee
ServiceNow Employee

It sounds like you need field_decorations (or ref_contributions), an attribute on the field that displays a UI Macro after the field.


See http://wiki.servicenow.com/index.php?title=Dictionary_Attributes#gsc.tab=0



Assume you want to add a help icon to the CI field ion an Incident when the Xfire CI is selected.


Find an icon image and add it to the Image gallery


Screen Shot 2016-08-31 at 9.55.08 PM.png



Create a UI Macro


Your condition for showing the icon is in the evaluate script here.


Screen Shot 2016-08-31 at 9.56.13 PM.png



Update the Attributes on the field in the Dictionary:


Screen Shot 2016-08-31 at 9.58.58 PM.png


Each attribute is separated by commas, and each value for one attribute is separated by semi-colons.



Please note that ref_contributions/field_decorations do not work on all field types.



The result is this


Screen Shot 2016-08-31 at 10.02.33 PM.png


Screen Shot 2016-08-31 at 10.02.48 PM.png


The icon will show when you save the form. You can use a Client Script to show it as soon as the field is changed.


Hi,



Do you happen to have any ideas on how to achieve an image to display under a field when a field decoration/icon is selected?   We would like to add a help icon next to our Impact and Urgency fields and when that icon is selected have it display an image or wording that explains what each selection means.   Attached picture is what we would like to achieve.



Appreciate any help you can give .



Niccole



find_real_file.png