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
In Salesforce, go to Setup.
Search for Files Connect in the Quick Find box.
Enable Files Connect.
Save your settings.

Google Drive
Google Auth Provider
Create an Authentication Provider for Google Drive
Using the credentials of your Google App for Work admin account, log in to https://console.cloud.google.com.
In the title bar, expand Select Project and click Create Project.
Enter a project name and location, and click Create.
In the project dashboard, click the menu icon in the upper left, and then click APIs & Services.
In the API manager, go to the Library tab and search for Google Drive API.
In the search results, click Google Drive API, and then click Enable API.
In the menu on the left, click Credentials.
In the OAuth Consent Screen tab, enter a valid email address and application name, and click Save.
In the Credentials tab, click Add credentials, and select OAuth client ID.
Select Web application, and click Create.
Copy the client ID and client secret values to a text file. Use these values next, when you create an authentication provider in Salesforce.
In Setup, enter Auth. Providers in the Quick Find box, then select Auth. Providers.
Click New.
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
Click Save.
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.
In the API Manager, in the menu on the left, click Credentials.
Click the previously created web app.
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
From Setup, enter External Data Sources in the Quick Find box, then select External Data Sources.
Click New External Data Source. Then set the following options.
FieldDescriptionLabel
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
Enter the Google Drive 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

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

Before creating a named credential, you must create an external credential to link it to. See Create or Edit an External Credential.
Make sure to add gmpkg in 'Allowed Namespaces for Callouts'
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
Edit the page in the Lightning App Builder.
Choose the File Explorer Component you are working on.
Paste the configuration below into the Actions property.
[
{
"label": "Add from GDrive",
"name": "Add_from_GDrive",
"component": "gmpkg:gdriveFilePickerLWC",
"attributes": {
"size": "small",
"storageCfg": "gdrive"
}
}
]
Google Drive Demo
Below is a quick demo on how to use the File Connect - Google Drive👇.
Amazon S3
External Credential
In Salesforce Setup, search for External Credentials.
Click New.
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).
Click Save.
Under Principals, click New.
Choose Named Principal.
Enter:
AWS Access Key ID in the Access Key field.
AWS Secret Access Key in the Access Secret field.
Click Save.

See how you can create yours here 👉: External Credential
Named Credential
Go to Setup and search for Named Credentials click New.
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.
Save.
See how you can create yours here 👉: Named Credentials

Before creating a named credential, you must create an external credential to link it to. See Create or Edit an External Credential.
External Data Source
Go to Setup and search for External Data Sources and click New.
Fill in:
External Data Source:
AWS S3
Name:AWS_S3
Type:
Simple URL
URL:
https://s3.amazonaws.com/<bucket-name>
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
Edit the page in the Lightning App Builder.
Choose the File Explorer Component you are working on.
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"
}
}
]
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.
In Setup, enter Auth. Providers in the Quick Find box, then select Auth. Providers.
Click New.
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.
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.
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
Save.
See how you can create yours here 👉: External Data Source

External Credential
In Salesforce Setup, search for External Credentials.
Click New.
Label: SharePoint.
Enter:
Name: Sharepoint
Authentication Protocol: OAuth 2.0
Authentication Provider: SharePoint
Click Save.
Under Principals, click New.
Choose Named Principal.
Parameter Name: Sharepoint User
Identity Type: Per User Principal
Click Save.

See how you can create yours here 👉 : External Credential
Named Credential
Go to Setup and search for Named Credentials click New.
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.
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
Edit the page in the Lightning App Builder.
Choose the File Explorer Component you are working on.
Paste the configuration below into the Actions property.
[
{
"label": "Add from Sharepoint",
"name": "Add_from_Sharepoint",
"component": "gmpkg:sharepointFilePickerLWC",
"attributes": {
"size": "small",
"storageCfg": "sharepoint"
}
}
]
Sharepoint Demo
Below is a quick demo on how to use the File Connect - Sharepoint👇.
Last updated
Was this helpful?