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.

Google Drive

Google Auth Provider

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.

  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 Google Drive API.

  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 Auth. Providers 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.

External Data Source

  1. From Setup, enter External Data Sources in the Quick Find box, then select External Data Sources.

  2. Click New External Data Source. Then set the following options.

    Field
    Description

    Label

    A user-friendly name for the data source displayed in the Salesforce user interface.

    Name

    A unique identifier used to refer to this external data source definition through the API. The Name 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.

    Type

    Choose Files Connect: Google Drive

    Identity Type

    The identity type used to authenticate to the external data source.

    Select Per User 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..)

    Select Named Principal to use the same set of credentials for every user who accesses the data source from Salesforce.

    Authentication Protocol

    The protocol used to access Google Drive.

    Select OAuth 2.0.

    Authentication Provider

    Scope

    Leave blank.

    Start Authentication Flow on Save

    Select to immediately test the settings above.

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.

See how you can create yours here 👉 : External Credential

External credential

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.

See how you can create yours here 👉 : Named credential

Named credential

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.

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.

To read more about the Custom Metadata Types 👉: Custom Metadata Types

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.

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

storageCfg property is the name of the Connect Config record described above.

Google Drive Demo

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

Amazon S3

External Credential

  1. In Salesforce Setup, search for External Credentials.

  2. Click New.

  3. Enter:

    • Label: AWS

    • 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.

See how you can create yours here 👉: External Credential

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

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:AWS_S3

    • Type: Simple URL

    • URL: https://s3.amazonaws.com/<bucket-name>

  3. Save.

See how you can create yours here 👉: External Data Source

Connect Config Metadata Type

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

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

To read more about the Custom Metadata Types 👉: Custom Metadata Types

Permission Set

See 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.

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

storageCfg property is the name of the Connect Config record described above.

S3 Demo

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

Sharepoint

Sharepoint Auth Provider

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

  1. In Setup, enter Auth. Providers 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.

See how you can create yours here 👉: Auth Provider

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

    • URL: Enter a placeholder value

    • Authentication Protocol: OAuth 2.0

    • Authentication Provider: Sharepoint

  2. Save.

See how you can create yours here 👉: External Data Source

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.

See how you can create yours here 👉 : External Credential

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

Permission Set

See Permission Set.

Connect Config Metadata Type

to read more about the Custom Metadata Types 👉: Custom Metadata Types

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.

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

storageCfg property is the name of the Connect Config record described above.

Sharepoint Demo

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

Last updated

Was this helpful?