Hardware Asset Management: How to get the asset count?

rahulyamgar
Tera Guru

Hello team,

 

We have various computer assets in our ServiceNow instance. There are 3 models which are normalized to single product/model using the HAMPro plugin by ServiceNow. 

 

So, we need to know the exact count based on the normalized model, how am I going to get it?

 

e.g. I have 4 models such as Dell Latitude 450, Latitude DellR 450, Dell Latitude x450 and all are normalized to single product as Latitude and model as 450. So if i have to get the count of all assets using the normalized model, do i need to get the normalized model  name and then go to each of the  parent record from the model table and see the related list to Assets from the model record? Please advise if I my understanding is wrong.

 

Thanks,
Rahul 

3 REPLIES 3

Amit Gujarathi
Giga Sage
Giga Sage

HI @rahulyamgar ,
I trust you are doing great.

To retrieve the count of assets based on the normalized model in ServiceNow, you can follow these steps:

  1. Identify the normalized model name you want to retrieve the count for, such as "Latitude 450."

  2. Use the ServiceNow Query Language (SNQL) to query the cmdb_model table to find the parent record associated with the normalized model. You can use the sysparm_query parameter to filter the records based on the normalized model name.

    Example query: cmdb_model?sysparm_query=name%3DLatitude%20450

  3. Once you have the parent record for the normalized model, access the related list of assets associated with that model.

    Example query: cmdb_model/parent_record_sys_id/assets

  4. Retrieve the count of assets from the related list. You can use the sysparm_count parameter in the URL to get the count directly.

    Example query: cmdb_model/parent_record_sys_id/assets?sysparm_count=true


Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



Hi @Amit Gujarathi A gentle reminder !

rahulyamgar
Tera Guru

Thanks @Amit Gujarathi , 

 

Only to correct my understanding, when model is normalized - it means models 'normalized_product' and normalized_model fields are correctly updated or set on the parent record. So while querying the number of assets, to get the normalized model, i need to filter the product model table with field normalized model and then against each of the product model record, i need to get the assets from relationship right? Please confirm my understanding.

 

Thanks,

Rahul Yamgar