We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to print an UI action and UI page?

manoharpatki
Tera Contributor

If I click on UI action then content should be printed from UI page, something like this I want to implement.

I am new to UI page, please anyone can help me with this, provide steps on what should be done.

Thanks!!

3 REPLIES 3

Samaksh Wani
Giga Sage

Hello @manoharpatki 

 

You need to use the g_scratchpad for passing the data.

 

Here you can overview the example

 

UI Action:

var sys_id=1234;
var vendor='This is the Vendor Name';
var caseNumber = 'abc1234567; 

var opsGenieOnCallInfo = {
	sys_id: sysID,
	vendor: vendorName,
	caseNumber: caseNumber
};
	
g_scratchpad.opsOnCallInfo = opsGenieOnCallInfo;


UI Page:

var passedData;

if (g_scratchpad.opsOnCallInfo){
	passedData = g_scratchpad.opsOnCallInfo;
}

 

Plz mark my solution as Accept, If you find it helpful.

 

Regards,

Samaksh

Ankur Bawiskar
Tera Patron

@manoharpatki 

what did you start with?

refer this link to get started

GlideDialogWindow: Advanced Popups Using UI Pages 

 

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

Samaksh Wani
Giga Sage

Hello @manoharpatki 

 

If you find my response as helpful, plz mark it as Accept. It will help future users.

 

Regards,

Samaksh