How can i fetch the SysID of the users in a report

Mahesh R
Kilo Explorer

How can i fetch the SysID along with user name of the SNOW users in a report ?

3 REPLIES 3

Community Alums
Not applicable

Hi @Mahesh R ,

It is possible for the report name and sysids

1.Create a custom fields on the form with the names sysid and Test fields as a string filed types   in user table form

2. Create a Business rule on user table (sys_user) like this for the both Insert and update select the both check boxes

(function executeRule(current, previous /*null when async*/) {

var sysid=current.sys_id;

      current.u_sysid=sysid;//Replace sysid as per ur wish

      gs.addInfoMessage(sysid);

})(current, previous);

3. Run the backgroundscript like this for updating the all the records in the database

var gr=new GlideRecord('sys_user');

gr.addActiveQuery();

gr.query();

while(gr.next()){

gr.u_text='hello am updating this records for populating all recordsysids in sysid field ';

gs.log(gr.getRowCount());

gr.update();

}

Finally you will get the report like this i hope this will helpful to u

 

find_real_file.png

Refer to this thread : https://community.servicenow.com/community?id=community_question&sys_id=c7954beddbd8dbc01dcaf3231f96...

 

Mark my answer correct & Helpful, if Applicable.

Thanks,
Sandeep

Community Alums
Not applicable

Hi @Mahesh R ,

Any update to this ?Any follow-up required? if not

Kindly mark the answer as Correct & Helpful both such that others can get help.

Thanks,
Sandeep

Community Alums
Not applicable

Hello,

Have  you checked below thread? 

https://community.servicenow.com/community?id=community_question&sys_id=e6d1c7a9db98dbc01dcaf3231f96...

 


Thanks
Akshay Kangankar
Please Mark ✅ Correct/helpful, if applicable,