Appiphony
 
  • Products
    • Merge Connect Document Generation
    • eSign Connect Docusign Integration
    • Parse Connect Document Parsing
    • Share Connect SharePoint Integration
    • Drive Connect Google Drive Integration
    • Experience Connect Experience Cloud Add-on
  • Company
  • Resources
    • Documentation Learn about our products
    • Blog Salesforce guides and tutorials
    • Customer Stories How our customers succeed
    • Videos Visit our YouTube channel
    • Company Get to know Appiphony
    • Careers View openings
    • PDO Services Build with Appiphony
    • PDO Customer Portal Access our customer portal
  • Pricing
Product Documentation Contact Us

How to Generate a Public Image in Salesforce?

In order to use the image field feature in Merge Connect for Google File Types, you must use a public link for your image. 

  1. Go to Files tab. 
  2. Select the dropdown icon for your desired image.
  3. Select View File Details.
  4. In the file details page, you will need to find the ID for your file in the URL field. 
  5. Select the Gear icon.
  6. Select Developer Console.
  7. Select Query Editor.
    8. In the query editor paste the following query where the id from file detail page’s URL is the ContentDocumentId value, then select Execute:SELECT Id FROM ContentVersion WHERE ContentDocumentId = '[id from file detail page]' AND IsLatest = true
  8. Copy the ID from the query results.
  9. Select the Logs tab.
  10. Select Debug.
  11. Select Open Execute Anonymous Window.
  12. In the Enter Apex Code window paste the following code, where the cvid is the id from the query, and select Execute:

    Id cvId = '[id from query]';

    ContentDistribution newCD = new ContentDistribution();
    newCD.Name = 'External Document Image';
    newCD.ContentVersionId = cvId;
    newCD.PreferencesAllowViewInBrowser = true;
    newCD.PreferencesLinkLatestVersion = true;
    newCD.PreferencesNotifyOnVisit = false;
    newCD.PreferencesPasswordRequired = false;

    insert newCD;

    ContentDistribution finalCD = [SELECT ContentDownloadUrl
    FROM ContentDistribution
    WHERE Id = :newCD.Id
    LIMIT 1];

    System.debug('--- COPY THIS URL ---');
    System.debug(finalCD.ContentDownloadUrl);
    System.debug('---------------------');
  13. Open up the generated log.
  14. Look for a URL in the logs, this URL is the public link you can use for your URL field value for image merge field use in Merge Connect.

Getting Started

  • Introduction
  • Installation & Setup
  • FAQs
    • How do I update Merge Connect?
    • Why Can't I Establish an Inbound Connection?
    • Can I trial Merge Connect?
    • How is Merge Connect used in a sandbox environment?
    • How to Generate a Public Image in Salesforce?
    • How do I open a support ticket with the Merge Connect team?
    • How do I fix the "Dynamic Imports are Not Allowed" Error?
    • How to Leave an AppExchange Review for Merge Connect
  • Release Notes

Features

  • Template Management
    • Creating Templates
    • Previewing
    • Downloading
    • Uploading
    • Editing
    • Publishing
    • Unpublishing
    • Renaming
    • Deleting
  • Merge Field Generation
    • Merge Fields
    • Lookup Merge Fields
    • Related Lists
    • Merging with Lists
    • Merging with Tables
    • Conditional Logic
    • Merging with Images
    • Repeating Slides
    • Merging with Rich Text
  • File Actions
    • Merging Files
    • Bundling Files
    • Viewing Files
    • Downloading Files
    • Creating Public Links
    • Sharing Files
    • Viewing File Details
    • Uploading New File Versions
    • Editing File Details
    • Deleting Files
  • Automation
    • Record-Triggered Flows
    • Autolaunched Flows
    • Screen Flows
  • Agentforce
    • Installing the Extension
    • Merging with Agentforce
    • Adding Agent Actions
    • Generating a Document
    • Emailing a Document
    • Deleting a Document

Integrations

  • Share Connect
    • Merging from SharePoint Links Component
    • Merging with Record-Triggered Flows
    • Merging with SharePoint Images
  • eSign Connect
    • Merged Documents in Envelopes

Billing

  • Purchase
  • Manage
    • Licenses
    • Term
    • Payment Info
    • Cancellation

Products

  • eSign Connect
  • Parse Connect
  • Share Connect
  • Merge Connect
  • Drive Connect
  • Experience Connect

Pricing

  • Drive Connect Pricing
  • eSign Connect Pricing
  • Share Connect Pricing
  • Merge Connect Pricing
  • Parse Connect Pricing
  • Experience Connect Pricing

Resources

  • Documentation
  • Blog
  • Customer Stories
  • Videos
  • Company
  • Careers
  • PDO Services
  • PDO Customer Portal

© 2026 Appiphony, LLC. All rights reserved.

Various trademarks held by their respective owners.

Manage Cookies • Policy & Terms
Loading Comments...