Hello ServiceNow Users,

Let’s say you want the Initial values of all the fields in the record of a particular table. Many time Iheard 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.

vararr=[];

vargrincident=new GlideRecord(‘incident’);

grincident.query();

while(grincident.next())

{
vargrhistory=new GlideRecord(‘sys_history_set’);

grhistory.addQuery(‘id’,grincident.sys_id);

grhistory.query();

if(grhistory.next())

{

var name = gs.getXMLText(grhistory.initial_values,”//cmdb_ci”);

if(name==null)

{

gs.addInfroMessege(‘Incident has No CI initially-‘+grincident.number);

}

else

{

gs.addInfroMessege(‘Incident has CI initially-‘+grincident.number);

}

}

}

Note-You just have to change the field name in above code.

We can also find it out Manually, Here are the Steps

1.Openan Incident record.

2.Right Click on form header >Configure>Related List

Search Initial Value

3.Find “Audit History” related list and bring it on right sidebucket , so that we can get a related list on incident form

Search Initial Value

4.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

Search Initial Value
Search Initial Value

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

Emergys Blog

Recent Articles

  • Agentic AI

    Agentic AI Helps Industrial Firm Transform Its RFP Response Process

    Agentic AI Helps Industrial Firm Transform Its RFP Response Process

    Creating RFP response content is a time-boxed process which [...]

    Creating RFP response content is a time-boxed process which places the RFP team under duress, [...]

  • SAP System with EHP8

    Maximize Efficiency and Future-Proof Your SAP System with EHP8

    Maximize Efficiency and Future-Proof Your SAP System with EHP8

    Organizations running on SAP ECC are increasingly challenged by [...]

    Organizations running on SAP ECC are increasingly challenged by rising maintenance costs, performance limitations, and [...]

  • Helping Enterprises Innovate

    SAP GROW & RISE – Helping Enterprises Innovate and Evolve

    SAP GROW & RISE – Helping Enterprises Innovate and Evolve

    SAP GROW and SAP RISE empower companies to scale effectively, [...]

    SAP GROW and SAP RISE empower companies to scale effectively, streamline operations, and achieve sustainable growth. [...]