Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Narsing1
Mega Sage

GlideScopedEvaluator API allows you to get the response from a "Script" field.  Here is an example in detail.

1. Create a Table like this

find_real_file.png

2. Create a record like this

find_real_file.png

3. Now, open Background script and get the response from Script field like this (set "myrequest" to 1)

var gr = new GlideRecord('u_glide_scope_evaluator_example');
gr.addQuery('sys_id','97d71738db003300a22c2fb7489619ca');
gr.query();
if(gr.next()){
var evaluator = new GlideScopedEvaluator();
evaluator.putVariable('myrequest',1);
var result = evaluator.evaluateScript(gr,'u_script',null);
gs.print(result.mystring);
}

4. Run the background script and you will see the following result.

find_real_file.png

5. Now, change the "myrequest" value to 2, you will see like this

find_real_file.png

 

This will be very much useful when you have a repeated code to be execute and to Customize based on a response.

 

Version history
Last update:
‎03-05-2019 07:26 AM
Updated by: