current.variables.variablename is returning undefined

Kamal17
Kilo Sage

Hi,

I have created a catalog item where i'm using two variables "category" and "sub category" which are of reference type.

Based on the value chosen in "category", the values in "sub category" are filtered.The following code is used in the subcategory's Reference qual condition.

javascript: new scriptincludeName().functionName(current.variables.category)

I'm passing the category value as a parameter to a script include function. But current.variables.category returns undefined.

Please share your suggestions to fix this issue.

Regards,

Kamal

1 ACCEPTED SOLUTION

Kamal17
Kilo Sage

Servicenow has suggested to clone the instance fix this issue.



Regards,


Kamal


View solution in original post

7 REPLIES 7

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Udhay,



Please go through the below wiki link for more info on how to use reference qualifier for catalog item.


Reference Qualifiers for Service Catalog Variables - ServiceNow Wiki


Reference Qualifier on Lookup Select Box Variable


Thanks Pradeep, But the issue is current.variables.variablename returns undefined.


Also when i tried using the "current.variables.variablename " directly inside script include its still returning undefined.



Moreover this issue is occurring in only one instance. The same code returns correct value in other instances.



Regards,


Udhay


variablename is correct?


Yes, variable name is correct. I have also tried passing current instead of the varaible value object to script include and retrieve the value from there but no luck.



This issue is happening in that specific instance for all Reference variables wherever i try to use current.variables.variablename inside Reference Qual condition.




Regards,


Udhay