Hardware Asset Management: How to get the asset count?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2023 08:13 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2023 02:38 AM
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:
Identify the normalized model name you want to retrieve the count for, such as "Latitude 450."
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
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 08:44 AM
Hi @Amit Gujarathi A gentle reminder !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2023 07:31 AM - edited 06-26-2023 07:32 AM
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