Upload Files to SharePoint directly into a subfolder (needs Before Trigger)

With File 365 you can automatically move files to a SharePoint subfolder, by using a Before trigger flow that uses the file365__SP_Path__c. By populating the SharePoint Subfolder path field, File 365 knows which subfolder it needs to move the file to.

This works for all files that meet the condition of that trigger, for example, all files with a certain extension or word in the filename etc. This should be done by an administrator. It should be clear that a user can not choose for an individual file where it should land in SharePoint when uploading a file to Salesforce.

Configure the Before Trigger flow: #

1. Create a New Flow

2. Select Type: Record-Triggered Flow

3. Configure the Start element

  • Object:
    • Select File365 (file365__f365_File365__c) from the list
  • Trigger the flow when:
    • A  record is created
  • Entry Conditions:
    • Select All Conditions Are Met (AND)
    • Set here the conditions for which files you want to transfer to the subfolder. For example to move files of a certain type, you can choose the File Extension field, f.e. File Extension Equals docx
  • Optimize the Flow for:
    • Fast Field Updates – Update fields on the record that triggers the flow to run. This high-performance flow runs before the record is saved to the database.

4. Add an Update Triggered Record element

    • Choose Label and API Name
    • How to Find records to Update and Set Their Values:
      • Select: Use the file 365 record that triggered the flow
    • Set Filter Conditions:
      • Select: None – Always Update Record
    • Set field Values for the File 365 Record
      • Use Subfolder Path field (file365__SP_Path__c) to define the subfolder where you want to move the files to. 
      • The Value you fill in here will be the name of the subfolder:

    5. Save and Activate the Flow

    What are your feelings
    Updated on 18 March 2025