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

How to call value form UI action to ui page

Venkatesh48
Tera Contributor

Hi Team,

I have a requirement in that i need to pass sys id form UI action to UI page in that i have to pass the sys id dynamically inside the glide record in UI page, Can you please let me know how can i archive this.

 

<g2:evaluate var="jvar_incident" >
var incident = new GlideRecord("incident");
incident.addQuery("active=true");
incident.setLimit(4);
incident.query();
incident;
</g2:evaluate>
 
Thank you.
1 REPLY 1

Not applicable

Hi @Venkatesh48 ,

You can use g_scratchpad. Here's how I used the scratchpad:

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;
}