Using HTML in Annotations

paulcurwen
Kilo Expert

Hi,

I'm pretty new to ServiceNow and was trying to do what I though would be a pretty simple thing, insert a horizontal line on a form.

Yes, I know you can use an Annotation of Line Separator but I just wanted a thinner, less black line than that gives.

Simple I thought. So I inserted an Annotation on the form made it type Text and HTML and in the Annotation Text entered:

<html>

<body>

<HR WIDTH="60%" NOSHADE>

</body>

</html>

This results in a Blue Annotation containing:

&lt;html&gt; &lt;body&gt; &lt;HR WIDTH="60%" NOSHADE&gt; &lt;/body&gt; &lt;/html&gt;

1 ACCEPTED SOLUTION

bernyalvarado
Mega Sage

Hi Paul, it sounds like you may want to modify the out-of-the-box Line Separator Annotation which you can find in the following link:



https://yourinstancename.service-now.com/nav_to.do?uri=sys_ui_annotation_type.do?sys_id=a93fc8e00f530000b12e6903cfe012e6



Instead of it being:



border-top: 2px solid black;



You may want to change it to:



border-top: 1px solid black;



I hope this helps!



Thanks,


Berny


View solution in original post

4 REPLIES 4

Anthony_vickery
Tera Expert

You can create your own custom annotation types. System UI > Form Annotation Types.


I often use one like this below. It uses a bottom border to show the line, so that when text is included, it sits above the line.



color: #1daa00;


border-bottom:2px solid #1daa00;


background-color:transparent;


display:block;



Or you could even use your system base colour by replacing #1daa00 above with ${base.color}


bernyalvarado
Mega Sage

Hi Paul, it sounds like you may want to modify the out-of-the-box Line Separator Annotation which you can find in the following link:



https://yourinstancename.service-now.com/nav_to.do?uri=sys_ui_annotation_type.do?sys_id=a93fc8e00f530000b12e6903cfe012e6



Instead of it being:



border-top: 2px solid black;



You may want to change it to:



border-top: 1px solid black;



I hope this helps!



Thanks,


Berny


Thanks for the responses everyone.



Ended up defining a new Form Annotation Type I call Light Grey Line with the style margin-top: 10px; border-top: 1px solid #E8E8E8;



Works a treat.


Hi There


I know this thread is a bit old, though would you modify the Form annotation type to include line breaks in the text?


I am happy using the Info Blue Box, though it ignores line breaks in the text and displays it in one line, like below



'If you are reading this you should ring the help desk on Ext 1362'



I would like it to display



'If you are reading this


you should ring the help desk


on Ext 1362'



Thanks in advance.



Chris