---
schema_version: "1"
id: c344e2f0731c48097bf411a34080a799695bf7f24da2c5e6e80ed9043baf1943
title: ViewDefinition
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforce-slack-sdk/apex-slack-sdk/guides/api_meta/meta_viewdefinition.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/guide/meta_viewdefinition.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 132c9448b872f88aa8287677ced5d83233b695f101635b75521d84df7a8eb760
products:
  - Apex SDK for Slack (Beta)
---
# ViewDefinition

Represents a view definition on a Slack app. This type extends the [MetadataWithContent](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_metadatawithcontent.htm) metadata type and inherits its `content` and `fullName` fields.

## Declarative Metadata File Suffix and Directory Location

The file suffix is `.view` for the view definition. The accompanying metadata file is named `YourViewName.view-meta.xml`. The files are stored in the `viewdefinitions` folder in the corresponding package directory.

## Version

Slack apps are available in API version 54.0 and later.

## Special Access Rules

To use this metadata type, your org must have Slack capabilities and packaging enabled.

## Fields

| Field Name    | Field Type                                  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `apiVersion`  | double                                      | Required. A double value that binds the view definition to a Salesforce API version.                                                                                                                                                                                                                                                                                                                                                                           |
| `content`     | base64Binary                                | The page content. Base 64-encoded binary data. Prior to making an API call, client applications must encode the binary attachment data as base64. Upon receiving a response, client applications must decode the base64 data to binary. This conversion is usually handled for you by a SOAP client. This field is inherited from the MetadataWithContent component.                                                                                           |
| `description` | string                                      | A description of the view definition.                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `fullName`    | string                                      | The developer name used as a unique identifier for API access. `fullName` can contain only underscores and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. This field is inherited from the [Metadata](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm) component. |
| `isProtected` | boolean                                     | Indicates whether the view definition is protected (true) or not (false). If true, only this package can reference the view definition directly.                                                                                                                                                                                                                                                                                                               |
| `masterLabel` | string                                      | Required. Name of the view definition that appears in the Salesforce user interface.                                                                                                                                                                                                                                                                                                                                                                           |
| `targetType`  | ViewTargetType (enumeration of type string) | Required. Specifies where the view can be used. Valid value is slack.                                                                                                                                                                                                                                                                                                                                                                                          |

## Declarative Metadata Sample Definition

This is the `hello.view-meta.xml` metadata file.

```xquery
<?xml version="1.0" encoding="UTF-8"?>
<ViewDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>54.0</apiVersion>
    <isProtected>false</isProtected>
    <masterLabel>Hello World Slack App</masterLabel>
    <targetType>slack</targetType>
</ViewDefinition>
```

Here's the corresponding `hello.view` definition. This view uses the `SlackApp` example with the slash command dispatcher. See [Define a View](https://developer.salesforce.com/docs/platform/salesforce-slack-sdk/build/views.md).

```yml
description: "Say Hello Example"
schema:
  properties:
    name:
      type: string
      required: true
components:
  - definition: modal
    properties:
      title: "Hello {!view.properties.name}"
    components:
      - definition: section
        properties:
          text: "You just said Hello from Apex!"
```

## Wildcard Support in the Manifest File

This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/docs/atlas.en-us.api_meta.meta/api_meta/file_based_zip_file.htm).
