Need to populate Asset Serial number in service catalog variable

varma2
Mega Sage

Hi All,

 

 

Need to populate requested for assets in lookup variable in catalog.

 

we have a requested for variable  and  we need to get the value of requested for Assets serial number from the (Alm_hardware ) table to populate in  (serialnumber_varible ) lookup select box in catalog item.

 

Please suggest.

 

Thank you all.

 

 

28 REPLIES 28

@varma2 

I don't think script include is required.

it should work fine as per what I mentioned.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar ,

 

Its working fine when remove the &colon . Now its filtering dedicated assets;

And then Based on serial_number i need to populate the CI name in Single line text  variable.

 

I used below callback function but its not fetching any value its showing undifine.

 

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
{
var mn = g_form.getReference('existing_serial_numberr', callback);
}
}

function callback(mn) {
alert('Value='+ mn.display_name);

g_form.setValue('CI', mn.display_name);


}

 

Please suggest

 

 

 

 

Thanks for your support.

 

elsaqazi
Giga Contributor

thank you soo much sir

elsaqazi
Giga Contributor

To populate the "serialnumber_variable" lookup select box in the catalog item, you can retrieve the value of the "requested for" Assets serial number from the "Alm_hardware" table. By fetching this value, you can dynamically populate the select box with the available serial numbers for the requested assets.