GlideScopedEvaluator - Global
-
- 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 scripts within the script field type. The scope of the record defines the scope of the script.
GlideScopedEvaluator - GlideScopedEvaluator()
Instantiates a GlideScopedEvaluator object.
Name | Type | Description |
---|---|---|
None |
Scoped equivalent
To use the GlideScopedEvaluator() method in a scoped application, use the corresponding scoped method: GlideScopedEvaluator().
GlideScopedEvaluator - evaluateScript(GlideRecord grObj, String scriptField, Object variables)
Evaluates a script from a GlideRecord field.
Name | Type | Description |
---|---|---|
grObj | GlideRecord | The GlideRecord containing a script expression. |
scriptField | String | (Optional) The name of the field containing the script expression. |
variables | Object | (Optional) A map of variables with name-value pairs. These variables are available to the script during execution of this method. |
Type | Description |
---|---|
Object | The result of the script execution. |
Example
Scoped equivalent
To use the evaluateScript() method in a scoped application, use the corresponding scoped method: evaluateScript().
GlideScopedEvaluator - getVariable(String name)
Returns a variable from a GlideScopedEvaluator object.
Name | Type | Description |
---|---|---|
name | String | The name of the variable. |
Type | Description |
---|---|
Object | The value of the specified variable. |
Example
Scoped equivalent
To use the getVariable() method in a scoped application, use the corresponding scoped method: getVariable().
GlideScopedEvaluator - putVariable(String name, Object value)
Puts a variable into the GlideScopedEvaluator object. These variables are available to the script that this GlideScopedEvaluator object runs.
Name | Type | Description |
---|---|---|
name | String | The name of the variable. |
value | Object | The value of the variable. |
Type | Description |
---|---|
void |
Example
Scoped equivalent
To use the putVariable() method in a scoped application, use the corresponding scoped method: putVariable().