Skip to main content

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

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)

In your Flow:

  1. Get the target File version

    • Identify the ContentVersionId for the file you want to share.
  2. Create ContentDistribution record

    • Provide the parent record ID (recordId)
    • Provide ContentVersionId
  3. Retrieve the new distribution record

    • Query the created ContentDistribution
    • Read DistributionPublicUrl
  4. Store and use the URL

    • Save DistributionPublicUrl on your business record (Opportunity, Quote, custom object, etc.)
    • Use this value in email templates, SMS messages, or other outbound channels
tip

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 DistributionPublicUrl back to your business record

Salesforce content delivery limitations (important)

Because shareable links are based on Salesforce ContentDistribution, Viewer automation inherits Salesforce content delivery constraints.

Known platform limitations
  • 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.

Source: Salesforce Help — Set Up Content Deliveries

Recommendation

Always preview a generated shareable link before sending it to customers, especially for documents with links, custom fonts, animations, or advanced formatting.

Use cases

  1. Send a proposal link in an email template and monitor proposal views
  2. Send a proposal link in SMS and monitor views/download events
  3. Send a proposal link in WhatsApp and monitor views/download events
  4. Send a proposal link in Telegram and monitor views/download events
  5. Notify internal users when a client views the shared file
  6. 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.

Yes. Once created, the same DistributionPublicUrl can be reused across channels such as email templates, SMS, and messaging apps.

Salesforce content delivery has viewer limitations (for example unsupported hyperlinks in online view and unsupported PowerPoint animations). Always preview the delivery link before sending.