Flow Actions

Get Resource Details

Introduction

The Get Resource Details flow action allows you to retrieve comprehensive metadata details of an external storage resource by inputting known metadata information, even if only a few parameters are available. The diagram below offers an overview of the input parameters and includes a visual representation of the flow action. Detailed explanations of each input parameter and the corresponding outputs will be provided in the following sections.

Document image


What This Action Does

The Get Resource Details flow action accepts certain combinations of Input paramaters i.e. metadata details of a resource and returns the complete metadata information as output. For instance, consider the following use case: when a new Account record is created, an Account folder is generated, along with a subfolder named "Opportunities" to store folders for all related Opportunity records. For instance, consider the following use case: when a new Account record is created, an Account folder is generated, along with a subfolder named "Opportunities" to store folders for all related Opportunity records.

To create an Opportunity folder within the "Opportunities" subfolder (located under the corresponding Account folder), you need the FolderId of the "Opportunities" subfolder. While you can use the Get Connected Folder action to find the Account folder by setting the ParentId to the Opportunity's Account Id, you can't directly retrieve the FolderId of the "Opportunities" subfolder.

In this case, you know that there is a subfolder named "Opportunities" within the Account folder. Therefore, the subfolder's path is can be formulated as the Account folder's path followed by "/Opportunities". This is where the Get Resource Details flow action is useful. By inputting the known metadata details such as Library, DriveId, Resource Path, and Resource Type, you can retrieve the ResourceId (the subfolder’s Id). This ResourceId can then be used to create an Opportunity folder within the Opportunities subfolder.

As you can see in the image, we are getting related Account folder details using "Get Connected Folder" action and then appending its path with subfolder's name and using this path into "Get Resource Details" to get resource of subfolder.
As you can see in the image, we are getting related Account folder details using "Get Connected Folder" action and then appending its path with subfolder's name and using this path into "Get Resource Details" to get resource of subfolder.


Similarly, if you know the Library, DriveId, Resource Path and Resource Type but do not have the ResourceId, you can retrieve the same using this action.

Since Google Drive does not have a Resource Path, retrieving ResourceId using Library, DriveId, Resource Path and Resource Type is NOT possible.

However you can use this for SharePoint and DropBox libraries.

Input Parameters

Let us discuss each of the input parameters in detail in the individual sections given below.

Drive Id

This is important for Google Drive & Sharepoint libraries only. The Drive ID is a unique identifier for a storage location in both SharePoint and Google Drive. In SharePoint, it represents a document library within a site, while in Google Drive, it identifies a user's drive or shared drive.

This is a mandatory input parameter.

You can get this parameter by viewing metadata details for a folder in the “Content Library” tab of CloudFiles app in Salesforce or can be fetched through other flow actions like Get Connected Folder.

Library

The Library parameter is the external storage type you are using. Possible values are sharepoint, google (for Google Drive), onedrive, dropbox, box, cloudfiles (for AWS S3).

This is a mandatory input parameter.

Resource Id

This is the folder Id of the target folder whose resource we want to be fetched.

It is mandatory to fill either Resource Id or Resource Path.

Resource Path

This is the path to the target folder whose resource we want to be fetched.

It is mandatory to fill either Resource Id or Resource Path.

In order to retrieve a File Resource details using Resource Path, the input Resource Path parameter must include file Name along with extension.

Resource Type

Specify fileor folder based on the type of Resource you are querying.

It is NOT mandatory and can be excluded.

Output Parameters

The action returns complete metadata information of the queried Resource.

The image depicts the Outputs of the action.
The image depicts the Outputs of the action.


Drive Id

The Drive Id of the queried Resource.

Library

The Library of the queried Resource.

Resource Id

The Resource Id of the queried File or Folder Resource.

Resource Name

The Name of the queried Resource.

In case, queried Resource Type = file, the Resource Name is output along with extension.

Resource Path

The complete Path for the queried Resource in the external storage .

Google Drive does not have a Resource Path.

You can use this for SharePoint and DropBox.

Type

The Resource Type of the queried Resource i.e. file or folder

See It In Action

The GIF below illustrates the use case discussed in the previous section: creating an Opportunity folder for each Opportunity record within the Opportunities subfolder of the corresponding Account’s folder.

Document image