---
schema_version: "1"
id: 680591a9c09e6b7e9e5f2a7328288d94435f1e0fbd8ac931a8843dba187fe52b
title: Get Object Layouts Examples
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/graphql-api/graphql/guides/query/query-record-layouts-examples.md
canonical_url: https://developer.salesforce.com/docs/platform/graphql/guide/query-record-layouts-examples.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 9fd657f97c649c0ba11233b6cf5045a9bc1ca60f21b2ff40741d8f7a5afb2909
products:
  - GraphQL API
---
# Get Object Layouts Examples

| AVAILABLE API VERSION |
| --------------------- |
| API v66.0 and later   |

## Get Object Layout

This example gets the layout for the account object.

```
{
  uiapi {
    recordLayouts(objectApiName: "Account") {
      edges {
        node {
          id
          layoutType
          mode
          objectApiName
          recordTypeId
          sections {
            heading
            columns
            rows
            collapsible
            layoutRows {
              layoutItems {
                label
                required
                editableForNew
                editableForUpdate
                uiBehavior
                layoutComponents {
                  apiName
                  componentType
                }
              }
            }
          }
        }
      }
      pageInfo {
        hasNextPage
        endCursor
      }
      totalCount
    }
  }
}
```

## Get Object Layout with a Record Type and Mode

This example gets the layout for the opportunity object with a record type and a mode.

```
{
  uiapi {
    recordLayouts(
      objectApiName: "Opportunity"
      recordTypeIds: ["012000000000000AAA"]
      mode: EDIT
      layoutType: FULL
      formFactor: LARGE
    ) {
      edges {
        node {
          id
          mode
          sections {
            heading
            layoutRows {
              layoutItems {
                label
                required
                layoutComponents {
                  apiName
                  componentType
                }
              }
            }
          }
          saveOptions {
            name
            label
            defaultValue
            isDisplayed
          }
        }
      }
    }
  }
}
```

## Get Object Layout with Record Type Overrides

This example gets the case layout with per-record-type mode and form factor overrides.

```
{
  uiapi {
    recordLayouts(
      objectApiName: "Case"
      layoutConfigs: [
        { recordTypeId: "012000000000001AAA", mode: EDIT, formFactor: LARGE }
        { recordTypeId: "012000000000002AAA", mode: VIEW, formFactor: SMALL }
      ]
    ) {
      edges {
        node {
          recordTypeId
          mode
          sections {
            heading
            layoutRows {
              layoutItems {
                label
                layoutComponents {
                  apiName
                  componentType
                }
              }
            }
          }
        }
      }
    }
  }
}
```

## Get Object Layout with Pagination

This example gets the account layout with pagination.

```
{
  uiapi {
    recordLayouts(objectApiName: "Account", first: 5) {
      edges {
        node { id recordTypeId }
        cursor
      }
      pageInfo {
        hasNextPage
        endCursor
      }
      totalCount
    }
  }
}
```

This example gets the next page.

```
{
  uiapi {
    recordLayouts(objectApiName: "Account", first: 5, after: "<endCursor>") {
      edges {
        node { id recordTypeId }
        cursor
      }
      pageInfo {
        hasNextPage
        endCursor
      }
    }
  }
}
```

## Get Object Layout with Polymorphic Components

This example gets the account layout with polymorphic components with inline fragments.

```
{
  uiapi {
    recordLayouts(objectApiName: "Account") {
      edges {
        node {
          sections {
            layoutRows {
              layoutItems {
                label
                layoutComponents {
                  apiName
                  componentType
                  ... on FieldLayoutComponent {
                    label
                  }
                  ... on VisualforceLayoutComponent {
                    visualforceUrl
                    height
                    width
                    showLabel
                    showScroll
                  }
                  ... on CanvasLayoutComponent {
                    referenceId
                    displayLocation
                    height
                    width
                  }
                  ... on CustomLinkLayoutComponent {
                    customLinkUrl
                    label
                    behavior
                  }
                  ... on ReportLayoutComponent {
                    reportId
                    filter
                    size
                    showTitle
                    hideOnError
                    cacheData
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
```

## See Also

[Get Object Layouts](https://developer.salesforce.com/docs/platform/graphql/guide/query-record-layouts.md)
