> For the complete documentation index, see [llms.txt](https://docs.gridmate.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gridmate.io/package-reference/components-library/files/gm-cloud-file-viewer.md).

# GM - Cloud File Viewer (Beta)

(gmpkg:cloudFileViewerLWC)

## **Documentation**

**GM - Cloud File Viewer (Beta)** component previews an external file referenced through Files Connect (SharePoint, Google Drive, Dropbox, Box, Amazon S3, ShareFile) directly on the **File** record page. The viewer displays the file title with its external data source, and the **Download** and **Open** buttons to get the file or open it in the storage provider.

{% hint style="warning" %}
This component is in Beta. It requires the GridMate Files Connect setup described in [File Explorer - File Connect](https://docs.gridmate.io/advanced-guides/other-components/file-explorer-file-connect.md).
{% endhint %}

**Use case:** Preview a SharePoint document from its Salesforce File record page without leaving Salesforce. See [File Explorer - File Connect](https://docs.gridmate.io/advanced-guides/other-components/file-explorer-file-connect.md).

## **Specification**

<table data-full-width="true"><thead><tr><th width="244">Property</th><th width="131.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>recordId</td><td>String</td><td>recordId of the file (ContentDocument) to preview. Keep this empty if you want to use the current record.</td></tr></tbody></table>

## **API Reference**

{% tabs fullWidth="true" %}
{% tab title="cloudFileViewerLWC.js-meta.xml" %}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>65.0</apiVersion>
    <isExposed>true</isExposed>
    <masterLabel>GM - Cloud File Viewer (Beta)</masterLabel>
    <description>GM - Cloud File Viewer</description>
    <targets>
        <target>lightning__RecordPage</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightning__RecordPage">
            <property
                name="recordId"
                type="String"
                label="recordId"
                description="recordId to use. Keep this empty if you want to use the current record"
            />
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gridmate.io/package-reference/components-library/files/gm-cloud-file-viewer.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
