The CreatorCon Call for Content is officially open! Get started here.

How to call the UI Macro on a Server Side Script?

User177031
Kilo Guru

Hi All,

Need your help on how to call the UI Macro in Server Side Scripting?

- Thank you.

4 REPLIES 4

Harshal Gawali
Giga Guru

Hi Sai,

Please refer below thread to know about use UI Macro in server side script.

call ui macro from business rule or script include or scheduled job

 

Regards,

Harshal

 

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Sai,

Can you share what requirement you are having which leads you to call UI macro from server side script?

Regards

Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

I want to grab the data from custom table and update it on a html field in knowledge article form as a table format.

Example: refer to the attached screenshot

So I though of creating a UI macro and calling it on Server Side Script.

- Thank you.

Vaibhav
Giga Guru

Hi Sai Venkatesh Suryadevara

To call UI Macro from Server Side we can use "GlideJellyRunner()" api.

example :  UI Macro calling from Business Rule


(function executeRule(current, previous /*null when async*/) {
	var runner = new GlideJellyRunner();

        var result = runner.runMacro('your_ui_macro_name');

        gs.addInfoMessage(result); 
	
})(current, previous);

Mark it correct/helpful if it helps you

Regards,
Vaibhav Chaudhari