To Get the Report of Users and Sys ID

sanithakavungal
Giga Contributor

Hi All,

Is it Possible to Get Report with User Name and Sys ID.

Please help..

User NameSys ID

Regards,

Sanitha

1 ACCEPTED SOLUTION

vinothkumar
Tera Guru

Hi Sanitha,



Please check the below link it would be helpful



Need to be sys_id in export files


View solution in original post

6 REPLIES 6

Venkateswarlu K
Mega Guru

Hi Sanitha


It is possible for the report name and sysids


But we have to do some stuff for this


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 u will get the report like this i hope this will helpful to u


find_real_file.png


sturton
Tera Guru

I know its an old post, however just wanted to share a workaround solution that I used to produce users by name and sys_id

Run a background script to display your users...

var usr = new GlideRecord('sys_user');
usr.addActiveQuery();
usr.query();

while (usr.next()){
gs.print(usr.name + ',' + usr.sys_id);
}

Copy/paste the return in excel, delimit by comma...use a formula to remove the '*** Script:' part (something like...'=right(A1, len(A1)-13)' for each row