Get ref SYS ID on archived Record

Meloper
Kilo Sage

Extending the archived records or their references.

Hello, when we archive records, only the display value of choices or references is taken.
Is there a possibility to query also the sys ID.
We archive records with references to the user table.
Since it is known that there are also name changes, we would need the SYS ID of the reference.

So my question is if it is possible to extend this. To get more Values than the Display Value?

 

1 ACCEPTED SOLUTION

Meloper
Kilo Sage

I used the archived log

 

var archive_log = new GlideRecord("sys_archive_log");
				archive_log.get("id", gr_hrcase_archive.getUniqueValue());
				
				var xmldoc = new XMLDocument(archive_log.payload);
				var user_sysid = xmldoc.getNodeText("//opened_for");
				gs.log("payload:getNodeText: user_sysid   " + user_sysid);

 

and

XMLDocument script object (servicenow.com)

View solution in original post

1 REPLY 1

Meloper
Kilo Sage

I used the archived log

 

var archive_log = new GlideRecord("sys_archive_log");
				archive_log.get("id", gr_hrcase_archive.getUniqueValue());
				
				var xmldoc = new XMLDocument(archive_log.payload);
				var user_sysid = xmldoc.getNodeText("//opened_for");
				gs.log("payload:getNodeText: user_sysid   " + user_sysid);

 

and

XMLDocument script object (servicenow.com)