Automate Shareable Links for Salesforce Files
Automatically generate Salesforce public file links with Flow by creating a ContentDistribution record and reading its DistributionPublicUrl. This pattern is useful for Viewer document workflows where you need to distribute generated files quickly through email, SMS, WhatsApp, or other messaging channels.
Overview
This automation pattern helps you publish and reuse Salesforce file links safely and consistently. You can:
- Create shareable links automatically after a file is generated
- Store the public URL on a business record for reuse
- Send one link across channels (email, SMS, chat apps)
- Track delivery activity using Salesforce content delivery metrics
- Apply known Salesforce limitations before sharing with customers
Introduction to Salesforce file sharing
Salesforce Files provide a secure way to store and share documents.
For customer-facing communication, shareable links are often more practical than sending large attachments.
With a shareable link, you can:
- Send the same file through multiple channels (email, SMS, messaging apps)
- Track engagement (views/downloads, where available)
- Revoke access when needed
Understanding the need for shareable links
Instead of manually creating links for every file, you can automate link creation in Flow.
This is useful when your process already generates documents (for example, proposals or quotes) and you want to immediately:
- Save the share link on a Salesforce record
- Send that link to the customer
- Monitor link activity
Configuring permissions for file sharing
Before building the flow, verify file distribution is enabled in your Salesforce org.
Checklist:
- Content Distribution is enabled
- Users running the Flow can access Files and create ContentDistribution records
- Target object has a field to store the generated public URL (optional but recommended)
Generating shareable link automatically
In your Flow:
-
Get the target File version
- Identify the
ContentVersionIdfor the file you want to share.
- Identify the
-
Create
ContentDistributionrecord- Provide the parent record ID (
recordId) - Provide
ContentVersionId
- Provide the parent record ID (
-
Retrieve the new distribution record
- Query the created
ContentDistribution - Read
DistributionPublicUrl
- Query the created
-
Store and use the URL
- Save
DistributionPublicUrlon your business record (Opportunity, Quote, custom object, etc.) - Use this value in email templates, SMS messages, or other outbound channels
- Save
Keep the generated URL in a dedicated text field so it can be reused across automations and reporting.
Flow pattern (quick reference)
- Input:
recordId,ContentVersionId - Create Records:
ContentDistribution - Get Records: fetch created distribution row
- Update Records: write
DistributionPublicUrlback to your business record
Salesforce content delivery limitations (important)
Because shareable links are based on Salesforce ContentDistribution, Viewer automation inherits Salesforce content delivery constraints.
- Hyperlinks in all file types are unsupported in the online content-delivery viewer.
- PowerPoint animations and timings are unsupported in online view.
- Files larger than 25 MB are unsupported for online view (recipients may only be able to download, depending on type and settings).
- Copy-protected PDFs are not supported for online viewing.
- Salesforce applies daily delivery view and bandwidth limits for service protection.
Always preview a generated shareable link before sending it to customers, especially for documents with links, custom fonts, animations, or advanced formatting.
Use cases
- Send a proposal link in an email template and monitor proposal views
- Send a proposal link in SMS and monitor views/download events
- Send a proposal link in WhatsApp and monitor views/download events
- Send a proposal link in Telegram and monitor views/download events
- Notify internal users when a client views the shared file
- Revoke file access when needed
Frequently Asked Questions
How do I generate a public Salesforce file URL in Flow?
Create a ContentDistribution record for the target ContentVersionId, then query and use the generated DistributionPublicUrl.
Where should I save DistributionPublicUrl?
Store it in a dedicated Text field on the related business object (for example Opportunity or Quote) so the same link can be reused in multiple automations.
Can I send the same shareable link by email and SMS?
Yes. Once created, the same DistributionPublicUrl can be reused across channels such as email templates, SMS, and messaging apps.
Why do some links show formatting differences from the original file?
Salesforce content delivery has viewer limitations (for example unsupported hyperlinks in online view and unsupported PowerPoint animations). Always preview the delivery link before sending.