GlideScopedEvaluator - Scoped
-
- UpdatedJan 30, 2025
- 2 minutes to read
- Yokohama
- API reference
The GlideScopedEvaluator API allows you to evaluate scripts in a GlideRecord field from both scoped and global server scripts.
This API evaluates records with script fields defined. The scope of the script is defined by the scope of the record.
GlideScopedEvaluator - GlideScopedEvaluator()
Instantiates a GlideScopedEvaluator object.
Name | Type | Description |
---|---|---|
None |
GlideScopedEvaluator - evaluateScript(GlideRecord grObj, String scriptField, Object variables)
Evaluates a script that resides in a GlideRecord field.
Name | Type | Description |
---|---|---|
grObj | GlideRecord | GlideRecord containing a script expression. |
scriptField | String | Optional. Name of the field containing the script expression. |
variables | Object | Optional. Map of variables with name-value pairs. These variables are available to the script during execution of this method. |
Type | Description |
---|---|
Object | Result of the script execution. |
Example
Output:
GlideScopedEvaluator - getVariable(String name)
Returns a specified variable from a GlideScopedEvaluator object.
Name | Type | Description |
---|---|---|
name | String | Name of the variable to return. |
Type | Description |
---|---|
Object | Value of the specified variable. |
Example
The following example shows how to call the getVariable() method to check the value of the answer variable.
GlideScopedEvaluator - putVariable(String name, Object value)
Sets a variable into the GlideScopedEvaluator object. These variables are available to the script that this GlideScopedEvaluator object runs.
Name | Type | Description |
---|---|---|
name | String | Name of the variable. |
value | Object | Value of the variable. |
Type | Description |
---|---|
None |
Example
The following example shows how to call the putVariable() method to set the answer variable to true.