- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 12:04 AM
I have an HTML field (text) on a knowledge base table and I want to display it's contents on a UI Page. I can get it to correct render the contents in some instances, however in some instance I get an error when rendering the Page. 'The entity "nbsp" was referenced, but not declared.'
My code :
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null" >
<div id="source-html">
<style>
table, th, td {
border: 1px solid black;
}
</style>
<button onclick="exportHTML();">Export as .doc</button>
<g:evaluate object="true" >
var sysparm_id = RP.getParameterValue("sysparam_id");
var choices = new GlideRecord("kb_knowledge");
choices.addQuery("sys_id", sysparm_id);
choices.query();
choices;
</g:evaluate>
<j:while test="${choices.next()}">
<g:no_escape>${HTML:choices.text.getDisplayValue()}</g:no_escape>
</j:while>
</div>
</j:jelly>
Anyone Help me on this. Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 06:04 AM
Hi,
So definitely issue with the html within the text as it is working in this case.
I believe for all other cases where the html is valid it should work
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 05:30 AM
Hi,
So it is not working in client instance but working fine in PDI.
Did you test with simple text as below? don't copy paste
<p>This is testing</p>
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 05:40 AM
This is working...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 06:04 AM
Hi,
So definitely issue with the html within the text as it is working in this case.
I believe for all other cases where the html is valid it should work
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2020 01:43 AM
Hi
i am facing the similar issue.
Can you please provide the solution for this.
Thanks,
Vamshi Krishna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 03:37 AM
i found that by entering &nbsp; it worked fine!