Asset tag benefits and population
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2020 07:21 AM
Hello,
What are some of the benefits of using the 'Asset Tag' field in ServiceNow and what are the best ways to populate the same.
Thanks
shanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2020 07:36 AM
Hi Shanks
answer to your first question:-
You can filter records on a table by tags you have access to.
Answer to your second question:-
Best way is to auto populate them
You need to write a onchange catalog client script on your catalog item. This script should do the following.
1.Run the script when the requested for changes
2.Query the asset table and fetch the corresponding records
3.Populated the variable on corresponding catalog item with the result.
You can try this sample script:-
You will be required to create one client script and one script include as stated below. The client script will make an ajax call to find the asset tags and then it will be set in your variable.
//Client script .Create a onchange client script of requested_for
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var ga = new GlideAjax('AssetListAjax');
ga.addParam('sysparm_name','GetAssetList');
ga.addParam('sysparm_user_id',g_form.getValue('REQUESTED_FOR')); // use you variable name here
ga.getXML(setAssetTag);
function setAssetTag(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if(answer!=''){
g_form.setValue('ASSET_TAG',answer); // Use your variable name here.
}
}
}
// Script include
Name of the script include - AssetListAjax and check the client callable checkbox
Copy the below function within the script include
GetAssetList: function()
{
var AstList = '';
var user_id = this.getParameter('sysparm_user_id');
var ast = new GlideRecord('alm_asset');
ast.addQuery('assigned_to',user_id);
ast.query();
While(ast.next())
{
AstList += ","+ast.asset_tag ;
}
return AstList ;
},
Some additional information is given below:-
Tracking your IT enterprise across all your work spaces is important for your company’s success and for reduction in wastage of assets like manpower, financials, time and infrastructure. Basically all your business functions need to work in harmony ( reduced noise) and coordination to your business goals.
The ServiceNow asset management portfolio tracks the financial, contractual and inventory details of hardware, software and virtual infrastructure – as well as non-IT assets – throughout their lifecycle. Asset requests are handled using workflows to obtain approvals, validate entitlements, issue chargebacks, provision services and more. Once an asset is deployed, Asset Management records all maintenance activity and enables IT to perform regular audits, right up until asset retirement.
Please Mark Correct and Helpful
Thanks and Regards
Gaurav Shirsat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2020 07:52 AM
Hi Gaurav,
I am not talking about 'Tags', but 'Asset Tag'. If you use servicenow discovery tool, it wont populate the asset tags on the hardware assets. So in such cases how to populate that field.