---
schema_version: "1"
id: 08e5d7621b54c3760f5283484c8d807c55c5d37908b4e6bd399b591c52cdd1e5
title: Environment
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/canvas-framework/guides/platform-connect/reference/environment-object.md
canonical_url: https://developer.salesforce.com/docs/platform/canvas-framework/guide/environment-object.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: bf4f59a7fef961c68ed57baddc6e66a0811667446e224f41d81e4f7892129423
products:
  - Canvas Developer Guide
  - Platform Developer Content
---

# Environment

The Environment object is a JSON-formatted object containing context information about the canvas app environment. This object contains the [Dimensions](https://developer.salesforce.com/docs/platform/canvas-framework/guide/dimensions-object.md) object, the [Record](https://developer.salesforce.com/docs/platform/canvas-framework/guide/record-object.md) object, the [Version](https://developer.salesforce.com/docs/platform/canvas-framework/guide/version-object.md) object, and parameters (if there are any) in the [Parameters](https://developer.salesforce.com/docs/platform/canvas-framework/guide/parameters-object.md) object.

|Field|Description|
|-----|-----------|
|`displayLocation`|The location in the application where the canvas app is currently being called from. Valid values are:<ul><li>Chatter—The canvas app was called from the Chatter tab.</li><li>ChatterFeed—The canvas app was called from a Chatter canvas feed item.</li><li>MobileNav—The canvas app was called from the navigation menu.</li><li>OpenCTI—The canvas app was called from an Open CTI component.</li><li>PageLayout—The canvas app was called from an element within a page layout. If the displayLocation is PageLayout, one of the subLocation values might be returned.</li><li>Publisher—The canvas app was called from a canvas custom quick action.</li><li>ServiceDesk—The canvas app was called from a Salesforce Console component.</li><li>Visualforce—The canvas app was called from a Visualforce page.</li><li>None—The canvas app was called from the Canvas App Previewer.</li></ul>|
|`locationUrl`|The URL of the page in Salesforce where the user accesses the canvas app. For example, if users access your canvas app by clicking a link on the Chatter tab, this field contains the URL of the Chatter tab.|
|`subLocation`|The sublocation in the application where the canvas app was called from when the canvas app is loaded in a mobile device. The subLocation is related to the displayLocation. Valid values for this field when the displayLocation is PageLayout are:<ul><li>S1MobileCardFullview—The canvas app was called from a mobile card.</li><li>S1MobileCardPreview—The canvas app was called from a mobile card preview. The user must click the preview to open the app.</li><li>S1RecordHomePreview—The canvas app was called from a record detail page preview.  The user must click the preview to open the app.</li><li>S1RecordHomeFullview—The canvas app was called from a page layout.</li></ul>|
|`uiTheme`|The default theme for the context organization.|

The following code snippet shows an example of the Environment object.

```nolang
"environment": 
{ 
    "parameters":{},
    "dimensions":
    { 
        "clientHeight": "50px", 
        "clientWidth": "70px", 
        "height":"900px", 
        "width":"800px",
        "maxHeight":"2000px", 
        "maxWidth":"1000px"
 
    }, 
    "record": {
        "attributes": {
            "type": "Account",
            "url": "/services/data/v68.0/sobjects/Account/001xx000003DGWiAAO"
        },
            "Id": "001xx000003DGWiAAO",
            "Phone": "(555) 555-5555",
            "Fax": "(555) 555-5555",
            "BillingCity": "Seattle"
    },
    "displayLocation":"PageLayout", 
    "locationUrl":"https://salesforce.com/some/path/index.html", 
    "subLocation":"S1MobileCardFullview",
    "uiTheme":"Theme3",
    "version":
    { 
        "api":"68.0", 
        "season":"SUMMER" 
     }
}

```

-   **[Dimensions](https://developer.salesforce.com/docs/platform/canvas-framework/guide/dimensions-object.md)**  

-   **[Record](https://developer.salesforce.com/docs/platform/canvas-framework/guide/record-object.md)**  

-   **[Parameters](https://developer.salesforce.com/docs/platform/canvas-framework/guide/parameters-object.md)**  

-   **[Version](https://developer.salesforce.com/docs/platform/canvas-framework/guide/version-object.md)**  


**See Also**  


-   [Context](https://developer.salesforce.com/docs/platform/canvas-framework/guide/context-object.md)
-   [Dimensions](https://developer.salesforce.com/docs/platform/canvas-framework/guide/dimensions-object.md)
-   [Record](https://developer.salesforce.com/docs/platform/canvas-framework/guide/record-object.md)
-   [Parameters](https://developer.salesforce.com/docs/platform/canvas-framework/guide/parameters-object.md)
-   [Version](https://developer.salesforce.com/docs/platform/canvas-framework/guide/version-object.md)

