The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Html variable is not visible on service portal requested item view

ghzelmed
Tera Contributor

Hello,

I'm experiencing an issue where HTML type variables (as well as label and macro UI types) are not being displayed in the Ticket Fields widget in Service Portal. I was directed to KB article KB0820434 which explains that modifying a specific line in the widget’s HTML should resolve this issue. According to the KB, the line in question is:

 

 

 

 

 

 

<div class="m-b break-word" ng-repeat="variable in data.variables | filter:{visible_summary:true}">

 

 

 

 

 

 

 

However, after thoroughly reviewing the Ticket Fields widget’s HTML code in my instance, I couldn’t find this line (line 37) or any similar code snippet that would allow me to apply the suggested fix.

Could someone please help me understand:

  1. Where can I locate this line or the equivalent logic within the Ticket Fields widget?
  2. How can I adjust the widget to ensure that HTML type variables are properly displayed on the Service Portal?

Any guidance or pointers to documentation would be greatly appreciated.

Thank you in advance for your help.

Best regards,

1 ACCEPTED SOLUTION

Hi @ghzelmed,

I was able to reproduce and solve the issue on my PDI.

 

Problem:

The issue is that the function isVisibleSummary() returning false for HTML variables although "Visible on Summaries" is set to true on the variable.

 

My HTML Variable (Visible on Summaries = true):

MediC_5-1742095706035.png

Variables from the widget (visible_summary = false):

MediC_6-1742096021380.png

(I would truly appreciate if you could follow-up with ServiceNow and share update on this).

 

Solution:

  • Create a new Script Include
  • Copy all the functions from the existing script include (GlobalServiceCatalogUtil)
    https://YOUR_INSTANCE.service-now.com/nav_to.do?uri=sys_script_include.do?sys_id=a80a35798358665004d...
  • Look for the function getVariablesForTask
  • Replace the highlighted line with true (This would make all variables visible on your Ticket Fields Widget even if they have Visible on Summaries set to false: But I guess that is also the approach suggested from ServiceNow, to edit the HTML line which is unfortunately not there anymore)
    MediC_0-1742094893666.png
    MediC_4-1742095584819.png

     

  • On your Cloned "Ticket Fields" widget, replace the Script Include name on your Server Script as highlighted below:
    MediC_1-1742094985224.png

     

  • Make sure the Cloned Ticket Fields Widget is the one on your Portal page.

What you could do to make it better, instead of always setting the value to true. You can create a new function on your script include and return true or false based on the value of visible_summary on your variable and use the returned value of this function.

 

Results:

OOTB Ticket Fields Widget (HTML field not visible):

MediC_2-1742095201896.png

 

Cloned Ticket Fields Widget (HTML field visible):

MediC_3-1742095244014.png

 

 


If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

View solution in original post

8 REPLIES 8

ghzelmed
Tera Contributor

Hi,  Yep, it s not empty.  

And the html script is OOB and were not modified.

That s why i published my question.

Hi @ghzelmed,

I was able to reproduce and solve the issue on my PDI.

 

Problem:

The issue is that the function isVisibleSummary() returning false for HTML variables although "Visible on Summaries" is set to true on the variable.

 

My HTML Variable (Visible on Summaries = true):

MediC_5-1742095706035.png

Variables from the widget (visible_summary = false):

MediC_6-1742096021380.png

(I would truly appreciate if you could follow-up with ServiceNow and share update on this).

 

Solution:

  • Create a new Script Include
  • Copy all the functions from the existing script include (GlobalServiceCatalogUtil)
    https://YOUR_INSTANCE.service-now.com/nav_to.do?uri=sys_script_include.do?sys_id=a80a35798358665004d...
  • Look for the function getVariablesForTask
  • Replace the highlighted line with true (This would make all variables visible on your Ticket Fields Widget even if they have Visible on Summaries set to false: But I guess that is also the approach suggested from ServiceNow, to edit the HTML line which is unfortunately not there anymore)
    MediC_0-1742094893666.png
    MediC_4-1742095584819.png

     

  • On your Cloned "Ticket Fields" widget, replace the Script Include name on your Server Script as highlighted below:
    MediC_1-1742094985224.png

     

  • Make sure the Cloned Ticket Fields Widget is the one on your Portal page.

What you could do to make it better, instead of always setting the value to true. You can create a new function on your script include and return true or false based on the value of visible_summary on your variable and use the returned value of this function.

 

Results:

OOTB Ticket Fields Widget (HTML field not visible):

MediC_2-1742095201896.png

 

Cloned Ticket Fields Widget (HTML field visible):

MediC_3-1742095244014.png

 

 


If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

ghzelmed
Tera Contributor

Thank you! I'll check with ServiceNow regarding why the summarize_visible attribute had a value of false instead of true. Your suggestion to verify the XML directly and question the displayed UI value for visible_summary was incredibly insightful—it really helped pinpoint the root cause. I greatly appreciate your thorough investigation and the time you've dedicated to resolving this issue.

I am glad I could help. Thank you!


If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.