nerdexam
ServiceNow

CAD · Question #185

Which of the following is the correct way to refer to a field in a GlideRecord query?

The correct answer is A. record.<field_name>. To access a field's value on a GlideRecord object, you use dot-walking notation with the GlideRecord variable name followed by the field's column name.

Submitted by lukas.cz· Apr 18, 2026Application Automation

Question

Which of the following is the correct way to refer to a field in a GlideRecord query?

Options

  • Arecord.<field_name>
  • Bfield.<field_name>
  • Cgr.<field_name>
  • Dgr.get('<field_name>')

How the community answered

(64 responses)
  • A
    88% (56)
  • B
    2% (1)
  • C
    8% (5)
  • D
    3% (2)

Why each option

To access a field's value on a GlideRecord object, you use dot-walking notation with the GlideRecord variable name followed by the field's column name.

Arecord.<field_name>Correct

After executing a query and retrieving a record using a GlideRecord object (e.g., `record`), its fields can be accessed directly using dot-walking notation (e.g., `record.field_name`).

Bfield.<field_name>

"field.<field_name>" is not the correct syntax for accessing a field on a GlideRecord object; `field` is not a standard GlideRecord instance name.

Cgr.<field_name>

While `gr.<field_name>` is a syntactically correct way to access a field if `gr` is the GlideRecord variable, `record.<field_name>` is also correct and often used as a general placeholder in documentation examples, making it the intended correct answer here.

Dgr.get('<field_name>')

`gr.get('<field_name>')` is a method that typically returns the display value or value of a specific field identified by a string, but the most direct and common way to access a field's value is using dot-walking directly, as in `record.field_name`.

Concept tested: GlideRecord field access syntax

Source: https://docs.servicenow.com/bundle/utah-application-development/page/app-store/dev_portal/API_reference/GlideRecord/concept/GlideRecordAPI.html

Topics

#GlideRecord#Scripting#Field Access#Syntax

Community Discussion

No community discussion yet for this question.

Full CAD Practice