Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Report on Assets which has changed the Location.

MFO1911
Tera Contributor

Hello togehter,

 

For our asset management, we need to produce a monthly scheduled report of all assets that have changed location.

The scheduled report should be an excel file listing all assets that are changed from a specific location to another specific Location and vice versa.

 

For Example: Asset A - with Location- A changes from Location A to Location B for Last Month

 

Is there an easy possibility for a simple report? If yes, please can someone explain in detail how to configure this report step-by-step? Do I have you to use Performance Analytics reports? I did not found a OOTB report or indicator.

 

Best Regards

 

MFO

 

 

 

 

 

2 ACCEPTED SOLUTIONS

Tai Vu
Kilo Patron
Kilo Patron

Hi @MFO1911 

You can define a Metric Definition to track the changes on the Location field. Once the Location changes, it will generate a new record into Metric Instance [metric_instance]. Then you can do reporting on this table.

Sample below

TaiVu_0-1697709434936.png

 

You can also leverage the Audit [sys_audit] table, if your instance has enabled audit for the Location field in alm_asset.

 

Try not to use sys_history_line and sys_history_set. Refer to this KB #KB0744473

TaiVu_1-1697709635156.png

 

Let me know if it works for you.

 

Cheers,

Tai Vu

 

View solution in original post

Hi @MFO1911 

Seems I missed this one. 😜

The metric instance generation is handled by this business rule.

Name: metrics events

URL: https://<instance_name>/sys_script.do?sys_id=35f9861dc0a808ae00ecf631cc51888c

 

Just clone the Business rule and change the table to Asset [alm_asset]. The event will be fired to generate metric instance.

 

Cheers,

Tai Vu

 

View solution in original post

8 REPLIES 8

Jaspal Singh
Mega Patron
Mega Patron

Hi,

Details are stored in history table but should not be used for reporting. Suggestion, will be to create a new field as Old Location and configure a BR to populate it as soon as the Location is changed to capture the old value.

Once done you can report on the fields directly.

Hello @MFO1911 ,

In the Filters section, add two filters: one for the previous location and another for the new location.


To filter for changes made in a specific time period, add a filter for the "sys_updated_on" field and set it to show records updated within your desired timeframe.

Thanks

Amarjeet Pal

Thanks. How will it help to report on?

Hi @Jaspal Singh,

 

Thanks for the quick reply. We do not want to use the history tables for the reporting.

We also want to avoid creating a new custom field in this table. Do you know another possibility maybe with Performance Analytics feature to create a daily snapshot of the location and check if the value has changed this month? 

 

Best Regards

MFO