Scoped GlideEvaluator - getVariable(String name)

Gets a variable from a GlideScopedEvaluator object.

Table 1. Parameters
Name Type Description
name String The name of the variable.
Table 2. Returns
Type Description
Object The value of the specified variable.
//setting up a record that contains the script to be executed.
gr = new GlideRecord('x_app_table'); 
gr.short_description = 'Calculate Addition';  
gr.calculate = "result = x + y"; 
var evaluator = new GlideScopedEvaluator();
evaluator.putVariable('x', 100);
evaluator.putVariable('y', 200);
evaluator.putVariable('result', null);
// Now retrieve the result 
gr = new GlideRecord('x_app_table'); 
gr.addQuery('short_description','Calculate Addition'); 
if ( { 
    evaluator.evaluateScript(gr, 'calculate', null);'result'));