Form annotation in service portal

Eli Guttman
Tera Guru

Hi,

Is there a way to user form annotation like line separator / Section details in service portal:

find_real_file.png

4 REPLIES 4

sachin_namjoshi
Kilo Patron
Kilo Patron

Please check below for solution to add annotation in SP.

 

https://community.servicenow.com/community?id=community_question&sys_id=a6eefae5db58dbc01dcaf3231f9619fc

 

Regards,

Sachin

Hi,

 

this show how to add field message - i'm looking for annotation in the form level - for a specific field.

It is available in the system platform, but not in the service portal.

Hi elig.

 

Did you find  solution for this issue . Annotation type fields are not visible in portal page.

 

Thanks,

Priya

Oleg
Mega Sage

Displaying of annotations on the form isn't supported in form widget of service portal. As far I know, one should not expect that the feature will be implemented in the future too. To understand why it's so, it's important to remark, that an annotation is very close to UI Macro and so, it can be more complex as simple plain text from your example.

To make your example multilinguale you should use the following text of annotation

${gs.getMessage("Operational/Logistics")}

instead of the text "Operational/Logistics" only. It shows the complexity of the problem. If you would examine texts used in annotations of standard ServiceNow instance you will find annotations like

<span id="cawt_annotation">
${new OnCallEscalationUtil().getCatchAllWaitTimeAnnotation()}
</span>

or like

${ALLOW_JELLY:gs.getMessage("Specify the data ...")}

(I reduced long text on the message till "...").

Thus, the text an annotation could be not only a text or a HTML, but it could contains code fragments, which have to be executed on the server side. Because of that the implementation of annotation support in common case is very complex. I guess, that because of that the feature is dropped in Service Portal.

If you really need to include some texts or HTML fragments on form and you need to display it on both desktop and Service Portal, than I could suggest you to use UI Macros instead of Annotations. Inside of UI Macro code it's possible to place common HTML fragments, which includes code fragments executed on the server side. By defining of UI Formatter for a table you makes UI Macro available for placing on Form of the table. Additionally, one can create small Service Portal widget, which makes the same job, what do UI Macro.

Finally, one needs add an entry in "Service Portal UI Formatter" table [sp_ui_formatter], which informs Service Portal, which Service Portal widget should be displayed on a form instead of UI Macro. The entry will maps your custom UI Macro to your custom widget.

I understand that the solution with UI Macro and widget is relatively complex and it's oversized if you just need to place simple text or  HTML text, but I see no other solution of your problem.