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.

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

Hi @Ankur Bawiskar 

 

Below is the client script.

 

 function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading)
return;
 
if(newValue === '')
g_form.setReadOnly('existing_serial_number', true);
else
g_form.setReadOnly('existing_serial_number', false);
}
 

 

varma2_0-1688467896361.png

Below is Name variable we need to give user name

varma2_2-1688468153703.png

 

 

below is the serial number lookup select box, whom ever selected above name the asset serial number which are allocated to that user should papulate below variable.

varma2_1-1688468006310.png

 

Please suggest.

@varma2 

in the variable attributes did you add as per what I mentioned above to the lookup select box?

ref_qual_elements=bmm_Namee

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

Hi @Ankur Bawiskar ,

 

Yes i have added the variable attributes same as ref_qual_elements=bmm_Namee

 

Please suggest.

 

Thanks,

@varma2 

so is it not filtering the assets?

are you sure the user you are selecting in reference for requested for has assets assigned to him/her?

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

HI @Ankur Bawiskar ,

 

Yes it is not filtering the assets and also i have selected user who having the assets assigned to him.

 

Please suggest.

 

Thanks,