AdvoLogix provides a built-in Apex method to update the SharePoint Folder Name automatically via Salesforce Flows that can be triggered whenever a record is updated.
Creating a Flow to Update a SharePoint Folder Name On Record Update
A background automation can be set for any object you have a SharePoint mapping configuration for. AdvoLogix provides a Flow Template named SharePoint: Update Folder Name, which includes a preconfigured setup of actions needed to update the folder name.
In Salesforce Setup, enter Flows in the Quick Find box, and select Flows.
- Select the New Flow action button in the page header to initiate a new Salesforce flow wizard.
- Switch to All + Templates tab.
- Select the SharePoint: Update Folder Name template from the list of available templates.
- Select the Next button.
You now have a custom flow that will be triggered when a record is edited. Your administrator can update the trigger options as well as provide a different object to trigger the process.
Understanding the Update Folder Name Flow Template Structure
- Choose your Object and Trigger mechanism based on whether you want your Folder Name to be updated whenever a record is updated. The Run Flow mechanism should remain with the default selection, as you would want the ability to initiate workspace operations after the Salesforce record has been saved and committed to the database.
- Prepares flow variables that will be passed as parameters to Update Folder Name Apex Action.
- Execute Update Folder Name Apex Action provided by AdvoLogix as a SharePoint utility method. Update Folder Name Apex method supports the following parameters:
- SObject Record (New) - Provide the record object/variable that stores the data of the record that has been changed. (Normally it will be {!$Record} variable)
- SObject Record (Old) - Provide the record object/variable that stores the data of the record that was saved in the database before the new changes. (Usually it should be {!$Record__Prior} variable)
- Salesforce Record ID - Provide the current record's record ID value here.
- Current Folder Path - [optional] Provide the relative path between the SharePoint Site and the location where your folder is to be located in.
- New Folder Name - [optional] Provide the folder's name to be updated to.
- Site Address - [optional] Provide the SharePoint Site Address. (See how to retrieve SharePoint Site Address)
- Folder Template Id - [optional] Provide a folder template's record ID value here, which will be used to generate a sub-folder structure within the new folder created here.
- Login As User ID - [optional] Provide a user ID (that is enabled as a Secured Logins user) to automatically authenticate your SharePoint-related operations within this flow action.
- Use Asynchronous Method - Provide a true/false value to indicate that this process is to be executed as an asynchronous approach.
When the Use Asynchronous Method is True, the Output Value for the SharePoint Folder is returned as null.
When a Login As user is provided within the app builder deployment options, all operations related to SharePoint are performed on behalf of that selected user. The current user cannot log in or log out from SharePoint connector from within the component.
If the provided secured logged in user logs out from their environment, then the user is logged out from all instances of the components where the secured login has been setup to use as via the Login As option.
The Update Folder Name Apex Action can be utilized within Process Builder as well. For more details about the Apex action, follow this link.
The Update Folder Name action renames the SharePoint folder without affecting its contents, permissions, or sub-folder structure. However, renaming a folder updates the folder's server-relative path in SharePoint to reflect the new name, so any previously saved bookmarks or direct links to the folder or its contents will no longer resolve and must be updated manually or must be bookmarked again.
