# File Explorer - File Connect

## Introduction

**GridMate File Connect** is a powerful integration feature that allows users to seamlessly access and interact with files stored in external systems including **Google Drive**, **Amazon S3**, **Dropbox**, **SharePoint**, and **Box**. This guide will walk you through the steps needed to configure Google Drive, Amazon S3, and SharePoint.

## **Enable Files Connect**

1. In Salesforce, go to **Setup**.
2. Search for **Files Connect** in the Quick Find box.
3. Enable **Files Connect**.
4. Save your settings.

<figure><img src="/files/XyU0RnRNvALOMhSMdj2q" alt=""><figcaption></figcaption></figure>

## Google Drive

### Google Auth Provider

&#x20;Create an Authentication Provider for Google Drive

1. Using the credentials of your Google App for Work admin account, log in to [https://console.cloud.google.com](https://console.cloud.google.com/).
2. In the title bar, expand **Select Project** and click **Create Project**.
3. Enter a project name and location, and click **Create**.
4. In the project dashboard, click the menu icon in the upper left, and then click **APIs & Services**.
5. In the API manager, go to the Library tab and search for <kbd>Google Drive API</kbd>.
6. In the search results, click **Google Drive API**, and then click **Enable API**.
7. In the menu on the left, click **Credentials**.
8. In the OAuth Consent Screen tab, enter a valid email address and application name, and click **Save**.
9. In the Credentials tab, click **Add credentials**, and select OAuth client ID.
10. Select Web application, and click **Create**.
11. Copy the client ID and client secret values to a text file. Use these values next, when you create an authentication provider in Salesforce.
12. In Setup, enter <kbd>Auth. Providers</kbd> in the Quick Find box, then select **Auth. Providers**.
13. Click **New**.
14. For Provider Type, select **OpenID Connect**, and then set the following options:
    * Name — Enter the name you want to appear in Salesforce.
    * URL Suffix — Enter the suffix at the end of the URL path. For example, in the path, <https://login.salesforce.com/services/authcallback/00Dx00000000001/GDrive>, the suffix is “GDrive”
    * Consumer Key — Enter the client ID you copied when creating the Google project.
    * Consumer Secret — Enter the client secret you copied when creating the Google project.
    * Authorize Endpoint URL —Enter <https://accounts.google.com/o/oauth2/auth?access\\_type=offline\\&approval\\_prompt=force>
    * Token Endpoint URL — Enter <https://accounts.google.com/o/oauth2/token>
    * Default Scopes — Enter openid email profile <https://www.googleapis.com/auth/drive>
15. Click **Save**.
16. At the bottom of the Auth. Provider detail page, copy the Callback URL entry to a text file. Use this URL when you edit the Google project next.
17. In the API Manager, in the menu on the left, click **Credentials**.
18. Click the previously created web app.
19. In the Authorized Redirect URIs section, add the Callback URL you copied when creating the authentication provider in Salesforce, and click **Save**.

<figure><img src="/files/RQ6PosUIcRVjQrm55esn" alt=""><figcaption></figcaption></figure>

### External Data Source&#x20;

1. From Setup, enter <kbd>External Data Sources</kbd> in the Quick Find box, then select **External Data Sources**.
2. Click **New External Data Source**. Then set the following options.<br>

   <table><thead><tr><th width="158.86566162109375">Field</th><th width="800">Description</th></tr></thead><tbody><tr><td>Label</td><td>A user-friendly name for the data source displayed in the Salesforce user interface.</td></tr><tr><td>Name</td><td>A unique identifier used to refer to this external data source definition through the API. The <strong>Name</strong> field 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.</td></tr><tr><td>Type</td><td>Choose <strong>Files Connect: Google Drive</strong></td></tr><tr><td>Identity Type</td><td><p>The identity type used to authenticate to the external data source.</p><p>Select <strong>Per User</strong> to require separate credentials for each user who accesses the data source. (Administrators must enable the data source for specific permission sets and profiles. Users then enter their credentials when first accessing the data source..)</p><p>Select <strong>Named Principal</strong> to use the same set of credentials for every user who accesses the data source from Salesforce.</p></td></tr><tr><td>Authentication Protocol</td><td><p>The protocol used to access Google Drive.</p><p>Select <strong>OAuth 2.0</strong>.</p></td></tr><tr><td>Authentication Provider</td><td>Enter the <a href="https://help.salesforce.com/s/articleView?id=experience.admin_files_connect_google_auth.htm&#x26;language=en_US&#x26;type=5">Google Drive authentication provider</a>.</td></tr><tr><td>Scope</td><td>Leave blank.</td></tr><tr><td>Start Authentication Flow on Save</td><td>Select to immediately test the settings above.</td></tr></tbody></table>

<figure><img src="/files/ld7dzoT6nYBerhFSArx5" alt=""><figcaption></figcaption></figure>

### External Credential

An **External Credential** is a secure configuration in Salesforce that defines **how authentication is handled when connecting to a remote system**, such as Google Drive or AWS.&#x20;

See how you can create yours here 👉 : [External Credential](https://help.salesforce.com/s/articleView?id=xcloud.nc_create_edit_external_credential.htm\&type=5)

<figure><img src="/files/Sar1qbIyZXdnoYswj9He" alt=""><figcaption><p>External credential</p></figcaption></figure>

### Named Credential

A **Named Credential** is a secure, configurable connection in Salesforce  that defines the **external system’s endpoint URL and authentication settings** in one logical unit.&#x20;

See how you can create yours here 👉 : [Named credential ](https://help.salesforce.com/s/articleView?language=en_US\&id=xcloud.nc_create_edit_named_credential.htm\&type=5)

<figure><img src="/files/5FwkegybnZZ69m2lcIKL" alt=""><figcaption><p>Named credential</p></figcaption></figure>

{% hint style="success" %}
Before creating a named credential, you must create an external credential to link it to. See [Create or Edit an External Credential](https://help.salesforce.com/s/articleView?id=xcloud.nc_create_edit_external_credential.htm\&language=en_US\&type=5).
{% endhint %}

{% hint style="warning" %}
Make sure to add gmpkg in 'Allowed Namespaces for Callouts'
{% endhint %}

### Permission Set

To enable the **File Connect** feature, create a new Permission Set or update an existing one following these steps:

* Create a Permission Set (File Connect User) to grant access to Google Drive credentials
* Select **Gdrive** External Credential Principal Access,
* Save your changes.

Follow the steps below to give access for a specific user:

* Go to advanced user details,
* Click on permission set assignments,
* Select **File Connect User** permission set,

You are ready to start using the **GridMate's File Connect** and enjoy all its benefits.

<figure><img src="/files/EjfzxFvuhTuxiR1odrif" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/zJ7U2aYyWSk5L0Aq1tbB" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/qnD18whEb4NycSpYhcJx" alt=""><figcaption></figcaption></figure>

### **Connect Config Metadata Type**

GM - File Explorer uses a Custom Metadata Type (Connect Config) as a single entry to interact with cloud storage. This configuration element contains:

* Configuration Label,
* Configuration Name,
* External Data Source Id,
* External Data Source Name,
* External Data Source Label,
* Named Credentials :  We are leveraging named credentials to align with security best practices.
* Options: options is a JSON string that contains any specific configuration for the targeted cloud storage.

<figure><img src="/files/FjuFhIevUab3smom8Zo4" alt=""><figcaption></figcaption></figure>

To read more about the Custom Metadata Types  👉: [Custom Metadata Types](https://help.salesforce.com/s/articleView?id=sf.custommetadatatypes_overview.htm)

### Google Drive **Action**

1. Edit the page in the Lightning App Builder.
2. Choose the **File Explorer** Component you are working on.
3. Paste the configuration below into the **Actions** property.

```coffeescript
[
     {
        "label": "Add from GDrive",
        "name": "Add_from_GDrive",
        "component": "gmpkg:gdriveFilePickerLWC",
        "attributes": {
            "size": "small",
            "storageCfg": "gdrive"
        }
    }
]
```

{% hint style="info" %}
**storageCfg** property is the name of the Connect Config record described above.
{% endhint %}

### Google Drive Demo

Below is a quick demo on how to use the **File Connect - Google Drive**👇.

{% embed url="<https://youtu.be/YYHNMJTA93w>" %}

## Amazon S3

### **External Credential**

1. In Salesforce Setup, search for **External Credentials**.
2. Click **New**.
3. Enter:
   * **Label**: AWS&#x20;
   * **Name**: AWS
   * **Authentication Protocol**: AWS Signature Version 4
   * **Region**: us-east-1
   * **Service:** s3
   * **AWS Account ID**: You can find it in the AWS console under your account settings (12-digit number).
4. Click **Save**.
5. Under **Principals**, click **New**.
6. Choose **Named Principal**.
7. Enter:
   * **AWS Access Key ID** in the **Access Key** field.
   * **AWS Secret Access Key** in the **Access Secret** field.
8. Click **Save**.

<figure><img src="/files/IXF3U1ARqJZBWeGvMFjK" alt=""><figcaption></figcaption></figure>

See how you can create yours here 👉: [External Credential](https://help.salesforce.com/s/articleView?id=xcloud.nc_create_edit_external_credential.htm\&type=5)

### **Named Credential**

1. Go to **Setup** and search for **Named Credentials**  click **New**.
2. Fill in:
   * **Label**: AWS S3
   * **Name**: AWS\_S3
   * **URL:** Your specific S3 bucket endpoint, e.g: `https://mybucket.s3.us-east-1.amazonaws.com`
   * **External Credential**: Choose the External Credential you created earlier.
   * **Allowed Namespaces for Callouts**: gmpkg.
3. Save.

See how you can create yours here 👉: [Named Credentials](https://help.salesforce.com/s/articleView?id=xcloud.nc_create_edit_named_credential.htm\&type=5)

<figure><img src="/files/K7Vfm61TTKzInXkylaGN" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Before creating a named credential, you must create an external credential to link it to. See [Create or Edit an External Credential](https://help.salesforce.com/s/articleView?id=xcloud.nc_create_edit_external_credential.htm\&language=en_US\&type=5).
{% endhint %}

### **External Data Source**

1. Go to **Setup** and search for **External Data Sources** and click **New**.
2. Fill in:
   * **External Data Source**: `AWS S3`
   * **Name:**&#x41;WS\_S3
   * **Type**: `Simple URL`&#x20;
   * **URL**: `https://s3.amazonaws.com/<bucket-name>`
3. Save.

&#x20;See how you can create yours here 👉: [External Data Source](https://help.salesforce.com/s/articleView?id=xcloud.nc_create_edit_awssig4_ext_cred.htm\&type=5)

<figure><img src="/files/Z8wCB1tRyZzI6qfQ24il" alt=""><figcaption></figcaption></figure>

### **Connect Config Metadata Type**

<figure><img src="/files/0BzEDY1EZSCiKT39CJTt" alt=""><figcaption></figcaption></figure>

The options for S3 should contain the Access Key, Secret Key, Bucket Name, and region.

```json
{
    "accessKey": "*******",
    "secretKey": "*************************",
    "bucket": "<bucket-name>",
    "region": "<aws-region>"
}
```

To read more about the Custom Metadata Types  👉: [Custom Metadata Types](https://help.salesforce.com/s/articleView?id=sf.custommetadatatypes_overview.htm)

### Permission Set

See [Permission Set](#permission-set).

### S3 **Action**

1. Edit the page in the Lightning App Builder.
2. Choose the **File Explorer** Component you are working on.
3. Paste the configuration below into the **Actions** property.

```coffeescript
[
    {
        "label": "Add from S3",
        "name": "Add_from_S3",
        "component": "gmpkg:s3FilePickerLWC",
        "attributes": {
            "size": "small",
            "storageCfg": "AWS_S3"
        }
    }
]
```

{% hint style="info" %}
**storageCfg** property is the name of the Connect Config record described above.
{% endhint %}

### S3 Demo

Below is a quick demo on how to use the **File Connect -**  S3👇.

{% embed url="<https://youtu.be/3IP0QgCksOI>" %}

## Sharepoint

### Sharepoint Auth Provider&#x20;

Before setting up Salesforce, ensure the authentication provider includes a redirect URI to register your app.

1. In Setup, enter <kbd>Auth. Providers</kbd> in the Quick Find box, then select **Auth. Providers**.
2. Click **New**.
3. For Provider Type, select **OpenID Connect**, and then set the following options.
   * Name — Enter the name you want to appear in Salesforce.
   * URL Suffix — Enter a suffix you want to appear at the end of the URL path. By default, the suffix reflects the Name entry.
   * Consumer Key — Enter a placeholder value.
   * Consumer Secret — Enter a placeholder value.
   * Authorize Endpoint URL — Enter a placeholder that begins with *https*.
   * Token Endpoint URL — Enter a placeholder that begins with *https*.
   * Default Scopes — <https://graph.microsoft.com/.default>.
4. Click **Save**. Then, at the bottom of the Auth. Provider detail page, copy the Callback URL entry to a text file.

<figure><img src="/files/KOSqAOkva3TUSYQGlsNZ" alt=""><figcaption></figcaption></figure>

See how you can create yours here 👉: [Auth Provider](https://help.salesforce.com/s/articleView?id=experience.admin_files_connect_sp_online_auth.htm\&type=5)

### **External Data Sources**

Go to **Setup** and search for **External Data Sources** and click **New**.

1. Fill in:
   * **External Data Source**: sharepoint
   * **Name:** sharepoint
   * **Type**: Files Connect: Microsoft SharePoint Online&#x20;
   * **URL**: Enter a placeholder value
   * **Authentication Protocol**: OAuth 2.0
   * **Authentication Provider**: Sharepoint
2. Save.

&#x20;See how you can create yours here 👉: [External Data Source](https://help.salesforce.com/s/articleView?id=experience.admin_files_connect_sp_online_auth_office365.htm\&type=5)

<figure><img src="/files/yXfKmYPBI8789uNnmeYg" alt=""><figcaption></figcaption></figure>

### **External Credential**

1. In Salesforce Setup, search for **External Credentials**.
2. Click **New**.
3. **Label**: SharePoint.
4. Enter:
   * **Name**: Sharepoint
   * **Authentication Protocol**: OAuth 2.0
   * **Authentication Provider**: SharePoint
5. Click **Save**.
6. Under **Principals**, click **New**.
7. Choose **Named Principal**.
   * **Parameter Name:** Sharepoint User
   * **Identity Type:** Per User Principal
8. Click **Save**.

<figure><img src="/files/QrDYvh2DFk3YsI7G9R1m" alt=""><figcaption></figcaption></figure>

See how you can create yours here 👉 : [External Credential](https://help.salesforce.com/s/articleView?id=xcloud.nc_create_edit_external_credential.htm\&type=5)

### **Named Credential**

1. Go to **Setup** and search for **Named Credentials**  click **New**.
2. Fill in:
   * **Label**: Sharepoint API
   * **Name**: Sharepoint\_API
   * **URL:** <https://graph.microsoft.com>
   * **External Credential**: Choose the External Credential you created earlier.
   * **Allowed Namespaces for Callouts**: gmpkg.
3. Save.

See how you can create yours here 👉: [Named Credentials](https://help.salesforce.com/s/articleView?id=xcloud.nc_create_edit_named_credential.htm\&type=5)

### Permission Set

See [Permission Set](#permission-set).

### **Connect Config Metadata Type**

<figure><img src="/files/akIxsWAPCvfTxMZpoDIk" alt=""><figcaption></figcaption></figure>

to read more about the Custom Metadata Types  👉: [Custom Metadata Types](https://help.salesforce.com/s/articleView?id=sf.custommetadatatypes_overview.htm)

### **Sharepoint Action**

1. Edit the page in the Lightning App Builder.
2. Choose the **File Explorer** Component you are working on.
3. Paste the configuration below into the **Actions** property.

```coffeescript
[
    {
        "label": "Add from Sharepoint",
        "name": "Add_from_Sharepoint",
        "component": "gmpkg:sharepointFilePickerLWC",
        "attributes": {
            "size": "small",
            "storageCfg": "sharepoint"
        }
    }
]
```

{% hint style="info" %}
**storageCfg** property is the name of the Connect Config record described above.
{% endhint %}

### Sharepoint Demo

Below is a quick demo on how to use the **File Connect -**  Sharepoint👇.

{% embed url="<https://youtu.be/QdghKXKM7WM>" %}

## Attach Folder

The **Attach Folder** capability in GridMate’s File Explorer enables users to associate external cloud storage folders with Salesforce records, providing direct visibility into external files without duplicating or storing them inside Salesforce.

Below is a step-by-step tutorial on how to use and use the **Attach Folder** feature 👇.

{% embed url="<https://youtu.be/CsD9lNvqGHs>" %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gridmate.io/advanced-guides/file-explorer-file-connect.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
