Skip to main content
Conga Support

Retrieving a document stored in a Salesforce file

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}'
 

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.