Are you using Salesforce Files to store documents?
Are you using Conga Composer to create complex mail merges in Salesforce?
Did you know you can pull files from a related object into your Conga Composer button with a nested SOQL query?
Use case: You are an organization that runs programs from various grants you receive. You track the grant received as an opportunity (grant amount) and you track every program participant on a custom object called Program Participation, which is related to the opportunity record. Each participant must submit an agreement and waiver, which you upload on the Salesforce Files section for each program participation record.
Your grant writer needs one PDF file consolidating the agreements and waivers of every program participant for a $100,000 grant awarded. Thus, you need to create a mail merge from an Opportunity record where you also merge in Salesforce Files from each related Program Participation record.
To pull the files of each Program Participation record, write a SOQL query in Conga Queries to pull the Salesforce File Ids of those records:
SELECT ContentDocument.Id FROM ContentDocumentLink WHERE LinkedEntityId IN
(SELECT Id FROM Program_Participation WHERE Opportunity = ‘{pv0}’) ORDER BY ContentDocument.Title ASC
When programming your Conga button, add the above query ID as the {QVAR0} record id:
https://composer.congamerge.com
?sessionId={!API.Session_ID}
&serverUrl={!API.Partner_Server_URL_290}
&id={!Opportunity.Id}&QVar0ID=id of query record you just created above
&TemplateID=primary conga templateID,{QVar0}
&define other parameters hereafter
*replace above bolded values with your custom object’s API values and actual salesforce ids.