Current.Variables.Variablename returning undefined in Business rule

kailashthiyagar
Kilo Guru

I m using a Business rule in my catalog item. I try to access the variable in my catalog item inside the Business rule as

current.variables.select_the_macro but its returning undefined..

I have one script include that executes as part of the workflow for that particular catalog item.. in that script include i m using as current.variables.select_the_macro.. There it works perfectly fine but not inside the BR..

So within BR, is there a different way to access the Catalog item Variable?

1 ACCEPTED SOLUTION

You should be using current.request_item.variables.variable_name



Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

12 REPLIES 12

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Kailash,



Are those variables i.e variable editor is shown on the catalog task form?


Hi Pradeep,



This is continuation of my previous post only.. i m writing the BR on sc_task table.. now i m realizing that if i have the BR on my sc_req_item, it might work like current.variables.select_the_macro.. but not on this.. is that rit



how to access the variables in catalog item in the business rule which was written on sc_task table.


ajbarnes
Tera Expert

Hi Kailash,


Is it a variable, or is it a script include. What are you trying to accomplish.


I have a BR on my Catalog Task... It is "After" "Update" BR.. I m writing a script in my BR and trying to access the Catalog item Variable..



ajbarnes