Hello ServiceNow Users,
Let's say you want the Initial values of all the fields in the record of a particular table. Many times I heard from many users that it is not possible.
But actually, it is possible. ServiceNow provides you a facility to check the initial values of any record even after that record values updated multiple times.
You can follow the below code to get the Initial Values of any record in any table.
Here I am fetching all the incidents whose CI's initial value is blank or not when initially the incident was created.
var arr = [];
var grincident = new GlideRecord('incident');
grincident.query();
while (grincident.next())
Note: You just have to change the field name in the above code.
We can also find it out manually. Here are the Steps:
- Open an Incident record.
- Right Click on form header > Configure > Related List
- Find "Audit History" related list and bring it on right sidebucket , so that we can get a related list on incident form
- Now, let's say you want to search value of "Configuration Item" that how many time the value is modified ,what is its initially value, what is current value, etc. You just have to find the incident field label name in label column of history table and right click on that name and click on "Show Matching" to filter the matching record
Here the number of records are 3 means 3 times value of "Configuration Item" is modified, with the "old" and "new"field you will get to know that what are the new and old values of that particular field.
Similarly, you can also group that record to find data of every field.
Author ,
Yash K.Agrawal
ServiceNow Consultant
Subscribe to our Newsletter
Subscribe to our Newsletter
Access new insights, employee stories, case studies and other activities going on in the Emergys enterprise