Flow Actions

Get Resource Property

Introduction

“Get Resource Property” Action can be used to get a Resource’s property value.

1 - Add “Get Resource Property” Action to your flow

In your flow builder, search for the element named “Get Resource Property”. You can also find this action in the CloudFiles category when you click the "Action" element in the "Add Element" box. Select the action to insert it into the flow.

2 - Configuration

  1. Property Name - Input the Resource property name in the external storage whose value is to be fetched. For example - name or description (The full list of parameters can be found at the end of the article).
  2. Resource - Input the resource(file/folder) whose property value must be fetched. You can use outputs of other Action elements in the flow like Get Event Details .
  3. Type (optional) - Input the Resource's type i.e. file or folder

NOTE: Sometimes, You cannot use outputs from other Actions like Get Connected Folder or Create Folder since Salesforce warns regarding a mismatch in Variable types. To avoid this, the best way would be to manuallly assign the outputs of the above actions to a apex-defined variable with apex-class as cldfs__resource.

For example, lets say you have used Get Connected Folder Action in your flow and you want to assign it's outcomes as an input to "Get Resource Property", then:

1 - Create a 'New Resource' with Resource Type = Variable >> Data Type = Apex-Defined >> Apex Class = cldfs__Resource

2 - While configuring the "Get Connected Folder" action, Go to 'Advanced' dropdown >> Check the 'Manually Assign Variables' checkbox.

3 - Store the output values in the newly created Resource variable by mapping the outputs to the Resource variable's parameters.

Mapping outputs to the newly created "test" variable.
Mapping outputs to the newly created "test" variable.


4 - Now you can configure this newly created cldfs: resource variable as an input to the Resource parameter of "Get Resource Property" Action element.

Document image


3 - Returned Value

“Get Resource Property” Action returns the value of the property.

List of Property Names:

  • name - gives the name of the resource
  • description - gives the description of the resource
  • id - gives the ID of the resource
  • driveId - gives the drive ID of the resource
  • library - gives the library that the resource is in
  • externalUrl - gives the cloud drive (Sharepoint, Google Drive, etc.) URL of the resource
  • path - gives the path of the resource in the cloud drive
  • type - gives the type of resource (file/folder)
  • size - gives the size of the resource
  • createdAt - gives the date of creation of the resource (not present in dropbox
  • updatedAt - gives the date when the resource was last updated
  • extension - gives the extension of the resource