how to fetch sysid of current record?

shahebaz5
Kilo Contributor

how to fetch sysid of current record?

1 ACCEPTED SOLUTION

AshishKM
Kilo Patron

Hi ,

You can open any record , and get the sys_id from header menu options ( as below )

find_real_file.png

 

If you are trying from some script using GlideRecord , you can get the sys_id of each record from object of GlideRecord ( see the sample code below )

var gr = new GlideRecord('sys_user');
gr.query();
 
while(gr.next()){
// print sys_id
gs.print(gr.sys_id);
 
}
 
Thanks,
Ashish
 
Please hit helpful / or / correct answer , if you find my response worthy based on the impact
 

View solution in original post

7 REPLIES 7

sachin_namjoshi
Mega Patron

Please use below method to get sys_id of current record

 

In Client script

g_form.getUniqueValue();


In business rule

current.sys_id;


Regards,
Sachin

Goran WitchDoc
ServiceNow Employee

Serverside: current.getUniqueValue();

ClientSide: g_form.getUniqueValue();

 

//Göran

AshishKM
Kilo Patron

Hi ,

You can open any record , and get the sys_id from header menu options ( as below )

find_real_file.png

 

If you are trying from some script using GlideRecord , you can get the sys_id of each record from object of GlideRecord ( see the sample code below )

var gr = new GlideRecord('sys_user');
gr.query();
 
while(gr.next()){
// print sys_id
gs.print(gr.sys_id);
 
}
 
Thanks,
Ashish
 
Please hit helpful / or / correct answer , if you find my response worthy based on the impact
 

AkshayPunekar31
Mega Expert

Hi shahebaz,

 

Refer the below code.

 

In Client Script:

var sysID=g_form.getUniqueValue();

 

In Business Rule:

var sysID=current.getUniqueValue();

 


Please mark reply as Helpful/Correct, if applicable. Thanks!

Warm Regards,

Akshay Punekar

find_real_file.png
www.dxsherpa.com