UI Page: "g_form" is not defined.

AndrewDiep
ServiceNow Employee
ServiceNow Employee

Hello,

 

So I am creating a UI page and I just want it to display the sys_id of the current record.

I keep getting the error that g_form is not defined. Is there a way to work around this? Thanks!

 

<?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 sys_id = g_form.sys_id;
	</g:evaluate>
	<div>
		${gs.getMessage("System ID: " + sys_id)}
	</div>
</j:jelly>

 

 

1 REPLY 1

Manmohan K
Tera Sage

Hi @AndrewDiep 

 

If you are clicking a ui action to open the UI page , then you can pass the sys_id of the record from the UI action to UI page 

 

Follow below thread for steps on how to  call UI page and pass parameter from ui action

https://www.servicenow.com/community/developer-forum/how-can-i-get-the-current-record-s-sys-id-in-a-...