Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

How to get the value of Numeric Scale catalog variable which is in sc_task?

Krithika R
Tera Contributor

Hi All,
I have a catalog variable type as Numeric scale which will be visible only on sc_task and that field is editable. 

KrithikaR_2-1668174155546.png

After making changes in this field value, the user will close the sc_task. Then there is a run script to get the value of this numeric scale for that i have used this run script.

 

 

var itemID = current.sys_id;
var ritmGR = new GlideRecord('sc_req_item');
if (ritmGR.get(itemID)) {
	var variable1 = ritmGR.currenrt.variables.number_of_fulfillment_tasks_to_netops_core.getValue();
	gs.log('krithika'+variable1);
}

 

 

But when I checked the logs it is giving undefined.

KrithikaR_3-1668174451239.png
Can anybody say how to get the value "4" in the log?

 

1 ACCEPTED SOLUTION

Raghav Sharma24
Giga Patron

 

 

var variable1 = ritmGR.variables.number_of_fulfillment_tasks_to_netops_core;

 

 

Also if you are writing BR on sc_task or sc_req_item below should also work:

current.variables.number_of_fulfillment_tasks_to_netops_core;


Please mark the answer correct/helpful accordingly.

View solution in original post

1 REPLY 1

Raghav Sharma24
Giga Patron

 

 

var variable1 = ritmGR.variables.number_of_fulfillment_tasks_to_netops_core;

 

 

Also if you are writing BR on sc_task or sc_req_item below should also work:

current.variables.number_of_fulfillment_tasks_to_netops_core;


Please mark the answer correct/helpful accordingly.