GlideElementDescriptor - Scoped, Global

  • Release version: Australia
  • Updated March 12, 2026
  • 5 minutes to read
  • The GlideElementDescriptor API provides information about individual fields in a glide record.

    There is no constructor for this class. Use the GlideElement or GlideRecord getED() method to obtain a GlideElementDescriptor object.

    GlideElementDescriptor - getAttachmentEncryptionType()

    Returns the encryption type used for attachments on the element's table.

    This method is for use with the Edge Encryption plugin.

    Table 1. Parameters
    Name Type Description
    None
    Table 2. Returns
    Type Description
    String The encryption type used on attachments. Returns null if attachments on the element's table are not being encrypted.
    var grInc = new GlideRecord('incident');
    grInc.query('priority', '1');
    
    var field = grInc.getElement('priority');
    var ed = field.getED();
    
    var isEdge = ed.getAttachmentEncryptionType();
    gs.info(isEdge);
    

    Output:

    null

    GlideElementDescriptor - getEncryptionType()

    Returns the element's encryption type.

    This method is for use with the Edge Encryption plugin.

    Table 3. Parameters
    Name Type Description
    None
    Table 4. Returns
    Type Description
    String The element's encryption type. Returns null if the element is not encrypted.
    var grInc = new GlideRecord('incident');
    grInc.query('priority', '1');
    
    var field = grInc.getElement('priority');
    var ed = field.getED();
    
    sEdge = ed.getEncryptionType();
    gs.info(isEdge);

    Output:

    null

    GlideElementDescriptor - getInternalType()

    Returns the element's internal data type.

    Table 5. Parameters
    Name Type Description
    None
    Table 6. Returns
    Type Description
    String The element's internal data type.
    Possible values:
    • boolean
    • char
    • collection
    • conditions
    • date
    • decimal
    • documentation_field
    • domain_id
    • due_date
    • email
    • field_name
    • file_attachment
    • float
    • glide_date
    • glide_date_time
    • glide_duration
    • glide_list
    • GUID
    • html
    • image
    • integer
    • long
    • longint
    • multi_two_lines
    • journal
    • journal_input
    • numeric
    • order_index
    • password
    • ph_number
    • reference
    • script
    • script_plain
    • string
    • sys_class_name
    • table_name
    • template_value
    • timer
    • translated_field
    • url
    • user_image
    • user_input
    • user_roles
    • video
    • workflow
    var grInc = new GlideRecord('incident');
    grInc.query('priority', '1');
     
    var field = grInc.getElement('priority');
    var ed = field.getED();
     
    var isEdge = ed.getInternalType();
    gs.info(isEdge);
    Output:
    integer

    GlideElementDescriptor - getLabel()

    Returns the element's label.

    Table 7. Parameters
    Name Type Description
    None
    Table 8. Returns
    Type Description
    String The element's label.
    var grInc = new GlideRecord('incident');
    grInc.query('priority', '1');
     
    var field = grInc.getElement('priority');
    var ed = field.getED();
     
    var isEdge = ed.getLabel();
    gs.info(isEdge);

    Output:

    Priority

    GlideElementDescriptor - getLength()

    Returns the element's length.

    Table 9. Parameters
    Name Type Description
    None
    Table 10. Returns
    Type Description
    Number The element's size.
    var grInc = new GlideRecord('incident');
    grInc.query('priority', '1');
     
    var field = grInc.getElement('priority');
    var ed = field.getED();
     
    var isEdge = ed.getLength();
    gs.info(isEdge);

    Output:

    40

    GlideElementDescriptor - getName()

    Returns the element's name.

    Table 11. Parameters
    Name Type Description
    None
    Table 12. Returns
    Type Description
    String The element's name.
    var grInc = new GlideRecord('incident');
    grInc.query('priority', '1');
     
    var field = grInc.getElement('priority');
    var ed = field.getED();
     
    var isEdge = ed.getName();
    gs.info(isEdge);

    Output:

    priority

    GlideElementDescriptor - getPlural()

    Returns the element's plural label.

    Table 13. Parameters
    Name Type Description
    None
    Table 14. Returns
    Type Description
    String The element's plural label.
    var now_GR = new GlideRecord('incident');
    now_GR.query();
    var ed = now_GR.getED();
    gs.info(ed.getPlural());

    Output:

    Incidents

    GlideElementDescriptor - hasAttachmentsEncrypted()

    Returns true if an encrypted attachment has been added to the table.

    This method is for use with the Edge Encryption plugin.

    Table 15. Parameters
    Name Type Description
    None
    Table 16. Returns
    Type Description
    Boolean Returns true if an encrypted attachment has been added to the table.
    var grInc = new GlideRecord('incident');
    grInc.query('priority', '1');
    
    var field = grInc.getElement('priority');
    var ed = field.getED();
    
    var isEdge = ed.hasAttachmentsEncrypted();
    gs.info(isEdge);

    Output:

    false

    GlideElementDescriptor - isAutoOrSysID()

    Returns true if the element is an automatically generated or system field.

    Automatically generated and system fields cannot be encrypted. This method is for use with the Edge Encryption plugin.

    Table 17. Parameters
    Name Type Description
    None
    Table 18. Returns
    Type Description
    Boolean True if the element is automatically generated or a system field.
    var grInc = new GlideRecord('incident');
    grInc.query('priority', '1');
    var field = grInc.getElement('priority');
    var ed = field.getED();
    
    isEdge = ed.isAutoOrSysID();
    gs.info(isEdge);
    

    Output:

    false

    GlideElementDescriptor - isChoiceTable()

    Returns true if the element is defined as a dropdown choice in its dictionary definition.

    Choice fields cannnot be encrypted.

    Table 19. Parameters
    Name Type Description
    None
    Table 20. Returns
    Type Description
    Boolean Returns true if the element is defined as a dropdown choice. Returns true even if there are no entries defined in the choice table. The last choice type, suggestion, does not return true.
    var grInc = new GlideRecord('incident');
    grInc.query('priority', '1');
    
    var field = grInc.getElement('priority');
    var ed = field.getED();
    
    var isChoiceTable = ed.isChoiceTable();
    gs.info(isChoiceTable);

    Output:

    true

    GlideElementDescriptor - isEdgeEncrypted()

    Returns true if an element is encrypted.

    This method is for use with the Edge Encryption plugin.

    Table 21. Parameters
    Name Type Description
    None
    Table 22. Returns
    Type Description
    Boolean Returns true if the element is encrypted, false otherwise.
    var grInc = new GlideRecord('incident');
    grInc.query('priority', '1');
    
    var field = grInc.getElement('priority');
    var ed = field.getED();
    
    var isEdge = ed.isEdgeEncrypted();
    gs.info(isEdge)

    Output:

    false

    GlideElementDescriptor - isEncrypted()

    Returns whether the field represented by this descriptor is configured for field encryption.

    Use this method to programmatically detect encrypted fields before reading or writing sensitive data, or to enforce access policies based on a field's encryption status.

    Required plugins: Field Encryption Starter (com.glide.field.encryption.starter). Without this plugin, isEncrypted() returns false.

    Table 23. Parameters
    Name Type Description
    None
    Table 24. Returns
    Type Description
    Boolean

    Flag that indicates whether the field is configured for field encryption.

    Valid values:
    • true: Field is configured for field encryption.
    • false: Field isn't encrypted, or the Field Encryption Starter (com.glide.field.encryption.starter) plugin isn't active.
    The following server-side script uses isEncrypted() to check whether the short_description field on the Incident table is encrypted before logging its value. Copy this into a Background Script or Business Rule on your instance to test.
    Note:
    Use the GlideRecord - getED() or Scoped GlideElement - getED() method to obtain a GlideElementDescriptor object.
    // Retrieve a sample Incident record
    var gr = new GlideRecord('incident');
    gr.setLimit(1);
    gr.query();
    
    if (gr.next()) {
        // Get the GlideElement for the field you want to inspect
        var element = gr.getElement('short_description');
    
        // Retrieve the descriptor from the element
        var descriptor = element.getED();
    
        // Check whether the field is configured for Field Encryption
        if (descriptor.isEncrypted()) {
            gs.info('short_description is encrypted. Value: ' + element.getDisplayValue());
        } else {
            gs.info('short_description is NOT encrypted. Value: ' + gr.getValue('short_description'));
        }
    }
    Output (unencrypted):
    short_description is NOT encrypted. Value: Unable to connect to network
    Output (encryption enabled on the field):
    short_description is encrypted. Value: Unable to connect to network

    GlideElementDescriptor - isMandatory()

    Determines whether the element is mandatory and must contain a value before the record can be saved.

    Table 25. Parameters
    Name Type Description
    None
    Table 26. Returns
    Type Description
    Boolean Flag that indicates whether the associated element is mandatory and must contain a value before the record containing the element can be saved.

    Possible values:

    • true: element must contain a value; mandatory field
    • false: element does not have to contain a value

    This example shows how to check whether the name field is mandatory.

    var isRecordValid;
    var now_GR = new GlideRecord('my_table');
    var field = now_GR.getElement('name');
    var elementDescriptor = field.getED();
    now_GR.query();
    while (now_GR.next()) {
    if (elementDescriptor.isMandatory() && !now_GR.name) {
           isRecordValid = false;
      }
    }

    GlideElementDescriptor - isVirtual()

    Returns true if the element is a virtual element.

    A virtual element is a calculated field as set by the dictionary definition of the field. Virtual fields cannot be encrypted.

    Table 27. Parameters
    Name Type Description
    None
    Table 28. Returns
    Type Description
    Boolean Returns true if the element is a virtual element.
    var grInc = new GlideRecord('incident');
    grInc.query('priority', '1');
    
    var field = grInc.getElement('priority');
    var ed = field.getED();
    
    var isVirtual = ed.isVirtual();
    gs.info(isVirtual);

    Output:

    false