<script custom-tag="" type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Embedding Reports In Jelly throwing errors related to 'GlideList2 is not defined'","image":"http://support.servicenow.com/29f1d2661baf6010cafa53d8624bcb43.iix","author":{"name":"ServiceNow Support","url":"http://support.servicenow.com/now"},"keywords":"ServiceNow, NowSupport public Knowledge Base articles, Known Error,KB0830031,","wordcount":"270","publisher":"ServiceNow","url":"https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0830031","datePublished":"2020-07-06","dateCreated":"2020-06-25","dateModified":"2024-04-08","description":"<h2>Embedding Reports In Jelly throwing errors related to 'GlideList2 is not defined'</h2><br/><div style=\"overflow-x:auto\"><h2>Description</h2><div><p>You can embed reports in any Jelly-based element","articleBody":"<h2>Embedding Reports In Jelly throwing errors related to 'GlideList2 is not defined'</h2><br/><div style=\"overflow-x:auto\"><h2>Description</h2><div><p>You can embed reports in any Jelly-based element, such as a UI page.</p></div><h2>Steps to Reproduce</h2><div> <p></p><ol style=\"list-style-position: inside;\"><li>Create new list report:</li><li>Navigator to Reports --> Create New</li><li>Create a new list report and copy the sys_id.</li><li>Create UI Page:</li><li>Type 'UI Pages' in filter navigator.</li><li>Create a new UI page with the following HTML code.</li></ol>\r\n<pre style=\"padding-left: 80px;\"><?xml version="1.0" encoding="utf-8" ?><br /><j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"><br /><g:inline template="reporting_includes.xml" /><br /><div id="report_stuff" /><br /><script><br />var div = $j("#report_stuff");<br />embedReportById(div,'ef319e251b9d941060e699c01a4bcb7e');<br /></script><br /></j:jelly></pre>\r\n<p style=\"padding-left: 40px;\">7. Now, click on 'Try It'.<br />8. Inspect the page and navigate to the console tab. </p>\r\n<p><br />Errors:<br />-- Observe errors in console logs as below<br />VM616:1 Uncaught ReferenceError: GlideList2 is not defined<br />at eval (eval at evalScript (js_includes_doctype.jsx?v=06-01-2020_0932&lp=Thu_May_28_22_08_08_PDT_2020&c=6_88:81), <anonymous>:1:12)<br />at evalScript (js_includes_doctype.jsx?v=06-01-2020_0932&lp=Thu_May_28_22_08_08_PDT_2020&c=6_88:81)<br />at _executer (js_includes_doctype.jsx?v=06-01-2020_0932&lp=Thu_May_28_22_08_08_PDT_2020&c=6_88:67)<br />at _executer (js_includes_doctype.jsx?v=06-01-2020_0932&lp=Thu_May_28_22_08_08_PDT_2020&c=6_88:68)<br />at _executer (js_includes_doctype.jsx?v=06-01-2020_0932&lp=Thu_May_28_22_08_08_PDT_2020&c=6_88:68)<br />at _executer (js_includes_doctype.jsx?v=06-01-2020_0932&lp=Thu_May_28_22_08_08_PDT_2020&c=6_88:68)<br />at _executer (js_includes_doctype.jsx?v=06-01-2020_0932&lp=Thu_May_28_22_08_08_PDT_2020&c=6_88:68)<br />at _executer (js_includes_doctype.jsx?v=06-01-2020_0932&lp=Thu_May_28_22_08_08_PDT_2020&c=6_88:68)<br />at _executer (js_includes_doctype.jsx?v=06-01-2020_0932&lp=Thu_May_28_22_08_08_PDT_2020&c=6_88:68)<br />at _executer (js_includes_doctype.jsx?v=06-01-2020_0932&lp=Thu_May_28_22_08_08_PDT_2020&c=6_88:68)<br />VM611:7 Uncaught ReferenceError: GlideList2NewHandler is not defined<br />at f (eval at evalScript (js_includes_doctype.jsx?v=06-01-2020_0932&lp=Thu_May_28_22_08_08_PDT_2020&c=6_88:81), <anonymous>:7:5)<br />VM614:1 Uncaught ReferenceError: GlideWidgetVCR is not defined<br />at eval (eval at evalScript (js_includes_doctype.jsx?v=06-01-2020_0932&lp=Thu_May_28_22_08_08_PDT_2020&c=6_88:81), <anonymous>:1:26)<br />VM615:1 Uncaught ReferenceError: GlideWidgetHideOnEmpty is not defined<br />at eval (eval at evalScript (js_includes_doctype.jsx?v=06-01-2020_0932&lp=Thu_May_28_22_08_08_PDT_2020&c=6_88:81), <anonymous>:1:26)<br /></p>\r\n<p><img style=\"align: baseline;\" title=\"\" src=\"sys_attachment.do?sys_id=4eb6a4a6db02b450e515c22305961944\" alt=\"\" width=\"831\" height=\"446\" align=\"baseline\" border=\"\" hspace=\"\" vspace=\"\" /></p></div><h2>Workaround</h2><div><p>We have a workaround for this embedReportById issue:</p>\r\n<ul style=\"list-style-position: inside;\"><li>Add <span style=\"font-family: 'courier new', courier;\"><g:inline template="list2_js_includes.xml" /></span> to the UI page code and errors in the console will be resolved.<br /></li></ul>\r\n<pre>HTML Code:<br /><?xml version="1.0" encoding="utf-8" ?><br /><j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"><br /><g:inline template="reporting_includes.xml" /><br /><strong><g:inline template="list2_js_includes.xml" /></strong><br /><div id="report_stuff" /><br /><script><br />var div = $j("#report_stuff");<br />embedReportById(div,'a1849841c611227b01646de563508c09');<br /></script><br /></j:jelly></pre></div><div><br /><strong>Related Problem: PRB1411595</strong></div></div>"}</script>