Loading...

ShareFile by Citrix is more than just a secure file-sharing platform; it’s also a document management powerhouse, particularly in businesses that value compliance, traceability, and automation. However, when multiple departments or teams require access to the same document versions in various folders, things can quickly become messy and disorganised.

This blog will show you how to use Salesforce Apex, OAuth 2.0 authentication, custom webhooks, and batch processing logic to automatically copy or update files from a central ShareFile folder to all subfolders. This scalable, low-maintenance solution ensures that your files remain consistent without requiring any manual intervention.

What is ShareFile?

ShareFile is a cloud-based file sharing and storage solution developed by Citrix, designed to help businesses securely manage, access, and collaborate on documents. It offers robust features for file storage, syncing, secure sharing, and remote access, making it especially valuable for industries with strict compliance requirements, such as legal, finance, and healthcare.

What sets ShareFile apart?

ShareFile has a strong emphasis on security and control. Users can send encrypted files, set access permissions, and track downloads. It also supports workflows like electronic signatures, feedback collection, and automated file retention, helping teams stay productive and compliant.

Whether you’re working from the office or remotely, ShareFile provides seamless access to your files through web, desktop, and mobile apps. With integration capabilities for tools such as Microsoft Outlook, Salesforce, and document management systems, it seamlessly integrates into most modern workflows.

In short, ShareFile is more than just a file-sharing tool, it’s a secure platform for document collaboration and business continuity.

Business Use Case of ShareFile

In many business environments, it’s important to keep files consistent across multiple folders, especially when different teams or departments rely on the same documents. With ShareFile, you can easily copy or update files from a central folder to various subfolders, ensuring everyone always has access to the most current version.

Below are the steps to copy or update files from one folder to all other folders or subfolders:

Step 1: Head to the ShareFile Login “https://api.sharefile.com” to generate an API Key.

Log in with your credentials for the ShareFile Account.

image 1

Enter your Subdomain name and enter the Email and password of your ShareFile Account.

Innovative Salesforce Customization Services

Step 2: Click on Get an API Key.
Step 3: Click on Create New to generate an API Key.
Step 4: Copy Client ID and Client Secret.

Updated Image 4

Log in to Salesforce and create an Auth. Provider with Open ID Connect.

Enter Client Id, Client Secret, Default Scopes and Token Endpoint URL as https://[subdomain].sf-api.com/oauth/token

Updated Image 5

Copy the Callback URL and update the Redirect URI in your ShareFile API key. Now, we will be creating External Named Credentials and Named Credentials.

Enter your domain URL as https://[subdomain].sf-api.com in the URL field for Named Credentials from your ShareFile API Account that you logged in earlier.

image 6 1
Updated Image 7

Step 5: Now, create Principal in External Credentials and configure it with your ShareFile account.

Create Remote Site Settings, add the URL of ShareFile and your ShareFile API account.

Now, we will be creating a Site for setting up webhook.

Updated Image 8

Step 6: We will add the permissions for External Credentials to our Site Profile and add the read permission to User External Credentials.

image 9

Step 7: We are all done with the setup of Auth 2.0 and will execute the webhook code using the specific folder ID we want to configure.

Step 8: After setting up the webhook for a specific folder, we will add our code to process folders and copy or update the files from the source folder to all target folders.

Step 9: Now, we will create a batch to process all child folders.

Step 10: We will create one more batch to process file uploading to all target folders.

At last, grant access to all the apex classes we created for ShareFile to the Site profile.

Here’s the demo video:

Conclusion:

Automating file management with ShareFile, especially tasks like copying and updating files across folders, can make a big difference in how efficiently your team works. By combining secure authentication, webhook integration, and custom logic, you can reduce manual effort and keep your documents consistent and up to date.

This setup not only saves time but also helps maintain better organization and control over your content. As your needs grow, you can continue to build on this foundation with more advanced automation or integration features.

No Data Found.

Related Articles
Orchestrator vs. Traditional Flows

Businesses use Salesforce automation to reduce manual work, improve efficiency, and automate repetitive business processes. Two commonly used automation approaches inside Salesforce are Traditional Flows and Flow Orchestrator. Traditional Flows are mainly used for simple automation tasks such as updating records, sending notifications, creating tasks, and automating business logic. Flow Orchestrator is designed for more […]

Read More
The Rise of Agentic Government_ What Salesforce’s 2026 Insights Mean for the Future of Public Sector AI

Government technology has often been seen as slower to evolve than the private sector. But Salesforce’s latest research challenges that idea in a big way. In fact, the new findings suggest that public sector organizations may now be moving faster than many businesses when it comes to adopting AI agents and preparing for a more […]

Read More
How To Use Email Service in APEX

Managing approvals, updates, and record changes directly from email can significantly improve efficiency within Salesforce workflows. Instead of logging in, navigating records, and manually updating fields, users can simply respond to emails and trigger automated updates using Email Service in APEX. This approach is especially useful for businesses leveraging Salesforce automation and looking to enhance […]

Read More
Design and Implementation of Salesforce Jira Task Integration 1 1

Businesses have been using Salesforce for CRM operations and Jira for Agile project tracking. However, without integration, teams manually update both systems, leading to data inconsistency and inefficiency.This mechanism establishes a real-time integration between Salesforce and Jira, allowing seamless synchronization of tasks and agile board statuses.  A custom Salesforce dashboard was developed that replicates Jira-style […]

Read More
Dark Mode in Salesforce Enabling It and Creating Theme Ready Lightning Web Components with SLDS 2.0 1 1

With the Winter ’26 release, Salesforce introduced Dark Mode in Lightning Experience. Dark Mode has been introduced as a beta feature in Winter ’26, and at first it was available only for Starter Edition orgs. It is now rolling out further with Spring ’26 to Professional, Enterprise, and Developer editions. To use Dark Mode, Salesforce […]

Read More
How to Merge and Brand PDF Files in Salesforce Using LWC Visualforce PDF LIB 1

Salesforce developers frequently encounter document automation requirements that go beyond standard Apex-based PDF generation. From merging multiple ContentVersion files to dynamically applying branding like watermarks and headers, traditional server-side approaches often hit Salesforce heap size limits (6MB/12MB), creating performance and scalability challenges. This guide presents a heap-limit-safe PDF merging architecture in Salesforce using Lightning Web […]

Read More
Our Location worldwide
Indian Flag India
3rd Floor, A-10, Pegasus Tower, Sector 68, Noida, Uttar Pradesh 201301 +91-1203239658
United States of America Flag USA
333 West Brown Deer Road Unit G – 366 Milwaukee WI, USA 53217 +1(262) 310-7818
United Kingdom Flag UK
7 Bell Yard, London, WC2A 2JR +44 20 3239 9428
Canada Canada
HIC Global Solutions INC
6D - 7398 Yonge St #1124 Thornhill, ON L4J 8J2 Canada +1(262) 310-7818