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

Related Posts

  • Service Level Agreement

    Service Level Agreement (SLA) for ServiceNow

    Service Level Agreement (SLA) for ServiceNow

    This blog is a one-stop shop for SLA. That [...]

  • ServiceNow for GRC Maturity

    ServiceNow for GRC Maturity

    ServiceNow for GRC Maturity

    Many businesses have kept a high priority on governance, risk, [...]

  • What Makes ServiceNow ITSM Important for Digital Transformation

    What Makes ServiceNow ITSM Important for Digital Transformation?

    What Makes ServiceNow ITSM Important for Digital Transformation?

    The adoption of technology for effectiveness, value, and innovation is [...]

Emergys Blog

Recent Articles

  • Large Language Models

    Verticalization of Large Language Models (LLMs): Unlocking Specialized Potential with Emergys

    Verticalization of Large Language Models (LLMs): Unlocking Specialized Potential with Emergys

    Large Language models (LLMs) have transformed Natural Language Processing [...]

    Large Language models (LLMs) have transformed Natural Language Processing (NLP); however, their generalist nature can [...]

  • Migrating from Remedyforce to BMC Helix

    Enhance Your IT Service Management: Migrating from Remedyforce to BMC Helix

    Enhance Your IT Service Management: Migrating from Remedyforce to BMC Helix

    In today’s rapidly evolving business landscape, organizations must constantly seek [...]

    In today’s rapidly evolving business landscape, organizations must constantly seek ways to optimize their IT service [...]

  • Service Desk Automation

    Top Candidates for Service Desk Automation

    Top Candidates for Service Desk Automation

    Automation is not new to anyone. It is the foundation [...]

    Automation is not new to anyone. It is the foundation for any enterprise digitization. However, companies [...]