Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

File Explorer - File Operations

Automate file management from Salesforce Flow with the GM - File Operation action.

Introduction

GM File Connect - File Operations is a GridMate Flow action that lets you manage files from your automations: upload files, attach files to records, and create folders, in Salesforce Files or in a cloud storage like Google Drive, SharePoint, Box, Dropbox, and Amazon S3.

The action is available in Flow Builder as GM - File Operation. Each run returns the IDs of the folders, files, or links it created, so later steps of the same Flow can use them. For example, you can create a folder, then create subfolders or upload files inside it.

Cloud operations require a configured cloud storage. See File Explorer - File Connect to set up Google Drive, Amazon S3, or SharePoint.

Operations

Operation Type
Storage
Description

ATTACH_FILE

Salesforce Files

Attaches existing Salesforce files to a record.

UPLOAD_FILE

Salesforce Files

Uploads a new file and attaches it to a record. Optionally adds it to a Library and folder.

CREATE_FOLDER

Salesforce Library

Creates a folder in a Salesforce Library. If the folder already exists, the existing folder is returned.

ATTACH_CLOUD_FILE

Cloud storage

Attaches cloud files to a record.

UPLOAD_CLOUD_FILE

Cloud storage

Uploads a file to the cloud storage.

CREATE_CLOUD_FOLDER

Cloud storage

Creates a folder in the cloud storage. Not supported on Amazon S3.

Inputs

Input
Description

Operation Type

Required. One of the operations listed above.

Record ID

Target record. Required for ATTACH_FILE, ATTACH_CLOUD_FILE and UPLOAD_FILE.

File IDs

Files to attach. Required for ATTACH_FILE and ATTACH_CLOUD_FILE.

File Metadata

JSON describing the file to upload (name, target folder). Required for UPLOAD_FILE and UPLOAD_CLOUD_FILE.

File Content

Base64 encoded file content. Required for UPLOAD_FILE and UPLOAD_CLOUD_FILE.

Folder Name

Name of the folder. Required for CREATE_FOLDER and CREATE_CLOUD_FOLDER.

Library Name

Salesforce Library name. Required for CREATE_FOLDER, optional for UPLOAD_FILE.

Parent Folder ID

Optional. Folder in which the new folder is created. If empty, the folder is created at the root.

Cloud Storage Cfg

Name of the Connect Config record. Required for cloud operations.

Outputs

Output
Description

Success

True when the operation succeeded.

Message

Success or error message.

Created IDs

IDs of the created folders, files, or links, as a text collection. For Amazon S3 uploads, the object key.

Example: Create Project Folders

In this example, a sales rep creates a project folder in Google Drive for an Opportunity, with Contracts and Invoices folders inside it, from a single click on the record page.

The flow: GM - Create Project Folders is a screen flow launched from an Opportunity quick action. It asks for a folder name (the Opportunity name by default), creates the folder in Google Drive, then uses the Created IDs output to create the Contracts and Invoices folders inside it. A final screen confirms the folders are ready, or shows the error message if something went wrong.

  1. Get Records: get the Opportunity using recordId.

  2. Screen: ask for the Folder Name.

  3. Action GM - File Operation: create the project folder.

    • Operation Type: CREATE_CLOUD_FOLDER

    • Cloud Storage Cfg: gdrive

    • Folder Name: the folder name from the screen

  4. Decision: check the Success output.

  5. Loop over Created IDs and assign the value to a ProjectFolderId variable.

  6. Action GM - File Operation (twice): create the Contracts and Invoices folders.

    • Operation Type: CREATE_CLOUD_FOLDER

    • Cloud Storage Cfg: gdrive

    • Folder Name: Contracts / Invoices

    • Parent Folder ID: {!ProjectFolderId}

  7. Screen: confirm that the folders are ready.

Created IDs is a collection. Use a Loop element (or any collection element) to read the ID before passing it to the next action.

How to add the action

1

Add an element

In Flow Builder, click the + icon where you want to add the action.

2

Choose Action

Click Action.

3

Select the action

Search for GM - File Operation and select it.

4

Set the inputs

Enter a Label, then set the Operation Type and the inputs required for the operation.

5

Save the flow

Click Done, then save and activate the flow.

Next steps

Demo

Below is a quick demo of File Connect - File Operations, where the user creates a project folder and its subfolders in Google Drive from a single Flow, without leaving the Opportunity record page

Last updated

Was this helpful?