How to get catalog variable values in business rule ?

Gopi22
Giga Guru

Hi,

How to fetch catalog variable value in an after business rule. 

I tried --> current.variables.<variable_name>  but not working correctly. 

Thanks,

Gopi

17 REPLIES 17

Hi Jaspal,

Yes, the RITM I am checking log for has user_name variable in the variable editor. 

Thanks,

Gopi

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Are you sure the BR ran?

What logs did you add and what's your analysis?

Regards
Ankur

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

Hi Ankur,

I am sure the BR ran. 

I have put 2 log statements as below: 

gs.log("Form field value is: "+current.u_requested_foor); // this is the requested for field on the RITM form

gs.log("Variable editor variable value is: "+current.variables.user_name); // this is the user name variable in variable editor in the same RITM form

 

The first statement returns the sys_id of the user (as expected) but the second statement returns undefined. 

 

Thanks,

Gopi

Hi,

is this happening for all variables under that RITM?

Are you checking this as an admin?

Regards
Ankur

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

Hello Ankur,

Yes I am an admin user. This is happening for all variables but not for any fields on the RITM form. 

 

Thanks,

Gopi