
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 03-05-2019 07:26 AM
GlideScopedEvaluator API allows you to get the response from a "Script" field. Here is an example in detail.
1. Create a Table like this
2. Create a record like this
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.
5. Now, change the "myrequest" value to 2, you will see like this
This will be very much useful when you have a repeated code to be execute and to Customize based on a response.
- 1,238 Views