Conga Product Documentation

Welcome to the new doc site. Some of your old bookmarks will no longer work. Please use the search bar to find your desired topic.

download

Retrieving a document stored in a Salesforce file

In Composer, you can use a query to retrieve documents and files stored in Salesforce. Very helpful for Files instead of Attachments

Use a SOQL query to retrieve files stored in Salesforce when launching a Composer button. To leverage a SOQL query that retrieves files stored in Salesforce, create a Conga Query record with the syntax below.

  • SELECT ContentDocument.id FROM ContentDocumentLink

    WHERE LinkedEntityId = '{pv0}'

Note: To show the most recent File from the related list, add the following to the query: ORDER BY ContentDocument.LastModifiedDate DESC LIMIT 1

To show File(s) that contain a key phrase, add the following to the query: AND ContentDocument.Title LIKE '%KeyPhrase%'

Add the new Conga Query record to a Composer button URL with the Qvar0ID, Qvar0Format, and TemplateID parameters. Reference the sample syntax below.

  • &Qvar0ID=QueryIDfromAbove &Qvar0Format=10000

    &TemplateId={qvar0}

Limited to 20 templates or document files.