---
schema_version: "1"
id: 665f9dff751a97a6d95b530d5de2ab9a84632ed26eadde043c9484cf66e71abb
title: Accessing Data with a Standard Controller
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-pages-developers-guide/guides/pages/controller-std/pages-controller-std-access-data.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-controller-std-access-data.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2613e2e5c84a703d66894e31c8e0fcd4a53f7116638095c52785b0fcc9796581
products:
  - Visualforce Developer Guide
  - Platform Developer Content
---

# Accessing Data with a Standard Controller

Every standard controller includes a getter method that returns the record specified by the `id` query string parameter in the page URL. This method allows the associated page markup to reference fields on the context record by using `{!object}` syntax, where _object_ is the lowercase name of the object associated with the controller. For example, a page that uses the Account standard controller can use `{!account.name}` to return the value of the `name` field on the account that is currently in context.

**note:** For the getter method to succeed, the record specified by the `id` query string parameter in the URL must be of the same type as the standard controller. For example, a page that uses the Account standard controller can only return an account record. If a contact record ID is specified by the `id` query string parameter, no data is returned by the `{!account}` expression.

As with queries in the Lightning Platform API, you can use merge field syntax to retrieve data from related records:

-   You can traverse up to five levels of child-to-parent relationships. For example, if using the Contact standard controller, you can use `{!contact.Account.Owner.FirstName}` (a three-level child-to-parent relationship) to return the name of the owner of the account record that is associated with the contact.
-   You can traverse one level of parent-to-child relationships. For example, if using the Account standard controller, you can use `{!account.Contacts}` to return an array of all contacts associated with the account that is currently in context.

