Scoped GlideElement - getChoiceValue()

Returns the choice label for the current choice.

A choice has a value (number) and a label (string). This method returns the label.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
String The selected choice's label.

var glideRecord = new GlideRecord('incident'); 
glideRecord.query('priority','1'); 
glideRecord.next(); 
 
// urgency has choice list: 1 - High, 2 - Medium, 3 - Low, with value: 1, 2, 3
var choiceLabel = glideRecord.urgency.getChoiceValue(); 
gs.info(choiceLabel);

Output:

1 - High