# Environment

The Environment object is a JSON-formatted object containing context information about the canvas app environment. This object contains the [Dimensions](/docs/platform/canvas-framework/guide/dimensions-object.md) object, the [Record](/docs/platform/canvas-framework/guide/record-object.md) object, the [Version](/docs/platform/canvas-framework/guide/version-object.md) object, and parameters (if there are any) in the [Parameters](/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](/docs/platform/canvas-framework/guide/dimensions-object.md)**

- **[Record](/docs/platform/canvas-framework/guide/record-object.md)**

- **[Parameters](/docs/platform/canvas-framework/guide/parameters-object.md)**

- **[Version](/docs/platform/canvas-framework/guide/version-object.md)**

**See Also**

- [Context](/docs/platform/canvas-framework/guide/context-object.md)
- [Dimensions](/docs/platform/canvas-framework/guide/dimensions-object.md)
- [Record](/docs/platform/canvas-framework/guide/record-object.md)
- [Parameters](/docs/platform/canvas-framework/guide/parameters-object.md)
- [Version](/docs/platform/canvas-framework/guide/version-object.md)
