GlideJellyRunner library

Domenico Nolfi
Giga Contributor

Good morning,

I have to create an interactive filter for a dashboard and install it as a widget.

Now, i have an existing filter that works on a date field.

function render() {
	var table = renderer.getPreferences().get("table");
	var field = renderer.getPreferences().get("field");
	if(table) {
		var jr = new GlideJellyRunner();
		renderer.getRenderProperties().setDeferInlineScripts(false);
		jr.setRenderProperties(renderer.getRenderProperties());
		jr.setTwoPhase(true);
		jr.setVariable('jvar_uid', randInt(100000, 999999) + '' + randInt(100000, 999999));
		if(field)
			jr.setVariable('jvar_field',field);
		jr.setVariable('jvar_table',table);
		return jr.runFromTemplate('interactive_date_filter.xml');
	}
	else {
		// Default to NOOP
		return 'Invalid widget type';
	}
}

My problem is that i have to create a new filter that use reference or string and change the correct template into the method "runFromTemplate' but I'm not able to find a GlideJellyRunner library documentation on ServiceNow.

Can you help me about the documentation or my needs ?

Thanks in advance,

Domenico

4 REPLIES 4

Pratiksha Kalam
Kilo Sage

Hi,

Refer below link  will help you,

https://hi.service-now.com/kb_view.do?sysparm_article=KB0596105

 

If my answer is worthy mark it as helpful and correct.


Regards,
Pratiksha

 

Domenico Nolfi
Giga Contributor

I thank you for the answer but it's not the solution.

My problem is that i don't know how to adapt

 

this

return jr.runFromTemplate('interactive_date_filter.xml');

 

to

line code for a text or reference field , but i'm not able to find any documentations

 

Many thanks

 

Daniel Fernand1
Tera Contributor

I have exactly the same problem in return jr.runFromTemplate('cmdb_widget_iframe.xml')

Rafal Rataj1
Giga Expert

was also looking on this, 

so the mystery is solved it is a UI Macro name +'.xml' 

for the whole filter build you can refer to this post 

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