How do getFieldValue and getFieldDisplayValue simplify extracting record field data in LWC?
Answer
Basics: getRecord returns a nested structure (record.fields.Name.value, record.fields.Name.displayValue). Reading it manually is verbose and breaks on relationship fields. The helper functions from lightning/uiRecordApi take the record and a field reference imported from @salesforce/schema and return the value safely, including through relationships such as Account.Owner.Name.
How it works: Import the field: import NAME from '@salesforce/schema/Account.Name';. Wire getRecord with recordId: '$recordId' and fields: [NAME] (or optionalFields). In a getter use getFieldValue(this.account.data, NAME). For picklists, dates, currencies and other types where the user-visible form differs, getFieldDisplayValue returns the label or locale-formatted string. If the record or field is missing, getFieldValue returns undefined.
Advanced / deep dive: The schema imports give compile-time validation and keep field references refactor-safe and dependency-aware (deleting a field is blocked while referenced). fields fails the whole request if the user lacks access to any field, while optionalFields silently skips inaccessible ones, which is why optional is safer for shared components. getFieldDisplayValue returns undefined when the API provides no display value (many text fields have none), so fall back to getFieldValue. Data comes from the LDS client cache, so multiple components share one request and see updates after updateRecord or notifyRecordUpdateAvailable. Cross-object paths cost nothing extra on the client but the field must be reachable through a relationship the user can see. Use for single records; use or Apex for sets of records.