Flow Actions

Set Resource Property

Introduction

Metadata properties in file storage systems, such as SharePoint, Google Drive, and others, represent key information about files or folders. These properties define the type of information you can store about a resource (file or folder) and are critical for organizing, filtering, and managing data effectively.

In systems like SharePoint, metadata properties function similarly to database fields or spreadsheet headers. For example:

  • Columns in SharePoint categorize and tag files with information like file type or status.
  • Properties in Google Drive include attributes like a folder's name, description, or permissions.

By leveraging metadata properties, you can ensure structured management and efficient retrieval of resources across platforms.

Columns in SharePoint are the fields or metadata associated with items in a list or document library. They define the type of information you can store about an item or file.

Document image


Common column types for file tagging include: Single Line of Text, Choice, Date and Time, Checkbox and many more. Columns enable better categorization and automation, ensuring efficient file management and discovery.

The CloudFiles: Set Resource Property flow action automates the process of updating or assigning metadata property values for resources across multiple storage systems, such as:

  • SharePoint: Update column values (e.g., Document Type, Status).
  • Google Drive: Modify properties like folder name or description.
  • Other Libraries: Set properties as supported by the specific platform.

This action enables seamless integration with Salesforce Flow Builder, allowing sophisticated automations for metadata management in diverse systems.

Document image


What this action does

The CloudFiles: Set Resource Property flow action allows you to:

  • Specify the target Resource using its metadata details.
  • Specify the columns to updated using their Property/Column API Names.
  • Dynamically assign values to these Properties/Columns via text input or flow resources.

This action supports batch updates, enabling you to update or assign multiple column values for a single resource in a single action execution.

Example Use Case

Scenario: Your Salesforce users upload files into SharePoint folders through CloudFiles LWCs on Account and Contact record pages. You want to capture specific metadata from these upload events and automatically tag the files in SharePoint.

For instance:

  1. If a file is uploaded from an Account record, set its Document Type column to "Account File" and the RecordId column to the associated Account's Record ID.
  2. If uploaded from a Contact record, set the same columns accordingly.

Automation Steps:

  1. Trigger the Automation: Configure a flow to trigger on the File Uploaded event.
  2. Filter Events: Use decision elements to filter the events based on the originating record's object type (e.g., Account or Contact).
  3. Set Resource Properties: Use the Set Resource Property action to update the file’s column values:
    • Assign "Account File" to the Document Type column and the Account's Record ID to the RecordId column for Account-originated uploads.
    • Similarly, tag files with appropriate values for Contact-originated uploads.

By automating column tagging, you ensure consistent metadata management, enhancing discoverability and supporting streamlined workflows.

Below is the flow snippet of the Example Use Case:

Document image


Input Parameters

Resource

The Resource parameter is used to specify the SharePoint Resource (File or Folder) whose column values are to be updated.

How to Configure the Resource Parameter

If you do not have the Resource parameter directly available, you can configure it by:

  1. Creating a cldfs_Resource variable in your flow.
  2. Assigning the Resource's metadata details (e.g., DriveId, Id, Library) to the variable.

These metadata details can be obtained from:

In the scenario described in the "What This Action Does" section, the uploaded file's metadata details are fetched using event details. The flow snippet below illustrates the steps to configure the Resource parameter:

Document image


Properties

The Properties parameter in the Set Resource Property action is where you define column value assignments for a Resource (File or Folder) in SharePoint. Each column to be updated requires two inputs:

  1. Property Name: Specifies the column (property) to update.
  2. Value: Specifies the new value for that column.
Document image


Property Name

Input the File/Folder (Resource) Property API name in the external storage whose value must be updated/set. 

Where to find the Property/Column's API Name ?

  • From External Storage directly find the API Names of Columns in a specific Document Library.
  • Alternatively, within Salesforce, go to:
    • CloudFiles App > Document Management > Widget Configuration
    • In the Widget Columns section, add required Columns to check their API Names by Navigating to the Storage Loaction, and find its API Name (displayed in brackets next to the Column Name).
Document image


When Updating a Resource's 'Name' Column/Property ?

  • To update the 'Name' column of a SharePoint Resource (File or Folder), you need to follow a special configuration:
    1. Separate Action for 'Name'
      • You must create a separate Set Resource Property Action for updating the 'Name' column.
      • Only the 'Name' column can be updated within this action.
      • No other columns (properties) can be updated in the same action when modifying the 'Name' column.
    2. Updating 'Name' and Other Columns
      • If you need to update both the 'Name' column and other columns simultaneously, you must Use two separate actions:
        • One action should be dedicated solely to updating the 'Name' column.
        • A second action should update all other columns.

Types of SharePoint Columns that Can Be Updated Using the Flow Action

Currently, the CloudFiles: Set Resource Property Flow Action supports updates for only the following two types of SharePoint columns:

  1. Single Line of Text
  2. Yes/No

For other column types, such as Date, Choice, and others, Manual Updates through the CloudFiles Widget/LWC are supported. However, these types are not yet supported for updates via the flow action.

Support for additional column types in the flow action will be added in future releases.

Value

Input the value to assign to the specified column.

The value can be:

  • Plain Text: Manually entered text.
  • Dynamic Resource: A value from a Salesforce Flow Resource (e.g., variables, formulas).
  • If Column Type is Yes/No then:
    • for Yes, Value = TRUE
    • for No, Value = FALSE

Output Parameters

This action does NOT generate any output. To confirm execution:

  • Check the updated values directly in SharePoint.
  • Verify column values via the CloudFiles LWC.