Dynamic Content Block display unwanted code before intended element

SyncWizard
Tera Contributor

Hi Everyone,

I am building a Dynamic Content Block that retrieves a unique array of short descriptions from a list of records, and then adds those as options for a "ui_choice_input_field" UI Macro.

 

This works, however there is a long line of script displayed before the actual element and I don't understand where it's coming from.

 

I attached a screenshot of the issue.

 

This is 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">

	<g:evaluate>
		var options = [];

		<!-- Get all the demand tasks assigned to this group -->
		var dmnTaskGR = new GlideRecordSecure("dmn_demand_task");
		dmnTaskGR.addQuery("assignment_group","cc4909c41b92edd019f6740f8b4bcbd1");
		dmnTaskGR.query();
		
		<!-- Get a unique list of short descriptions from these demand tasks -->
		while(dmnTaskGR.next()) {
			var shortDesc = dmnTaskGR.getValue("short_description");
			if(!(options.indexOf(shortDesc) >= 0)) {
				options.push(shortDesc);
			}
		}
	</g:evaluate>

	<g:ui_choice_input_field id="shortDescInput" name="shortDescInput" label="Short description:">
		<option value="none">--None--</option>

		<!-- Create an option value for each unique short description value -->
		<j:forEach var="jvar_options" items="${options}">     
			<option value="optVal">${jvar_options}</option>
		</j:forEach>
	</g:ui_choice_input_field>

</j:jelly>

 

This is the code that the dynamic content block displays:

 

var accessibleTooltips = (gs.getPreference('glide.ui.accessibility.accessible.tooltips', 'true') == 'true'); 
accessibleTooltips;
var accessibleDateFormat = (gs.getPreference('glide.ui.accessibility.accessible.dateFormat', 'false') == 'true');
accessibleDateFormat;
var labelTitle = jelly.jvar_element_hint;
var buttonStyle = "display: none;";

if (labelTitle) { 
    if (labelTitle.length > 0) { 
        buttonStyle="";
    }
}

buttonStyle;

var labelTitle = jelly.jvar_element_hint;
var ariaHidden = "true";
if (labelTitle) {
    if (labelTitle.length > 0) {
        ariaHidden="false";
    }
}
ariaHidden;

if (typeof(__ref__) == 'undefined') {
    var __ref__ = null;
    var __ref_string__ = '';
}

 

 

Thanks in advance