Skip to main content
Conga Support

Convert Data Gathering Reports to Queries for Conga Trigger Solutions

Conga Trigger solutions require Conga Queries to gather additional data for merged documents. Salesforce Reports do not successfully retrieve template data for Conga Trigger solutions.

Users must convert existing reports used in Conga Trigger solutions to Conga Queries to ensure that template data merges successfully. Converting a data gathering report to a Conga Query also requires updates to merge field syntax in a Conga Trigger solution's Conga Templates . 

Follow the steps below to convert reports to Conga Queries and make the necessary merge field syntax updates in. 

Convert a Report to a Conga Query

  1. Navigate to the Salesforce Report used in the Conga Trigger solution to reference the fields needed for the SOQL query. 
    • It is recommended to keep the report open in a separate browser tab for reference.
    • In the example below, the report is pulling Opportunity information related to an Account record.clipboard_eae9fa328dacdcfb21af93beadbedf2a7.png
  2. Click the Conga Queries tab
  3. Click New to create a new Conga Query record. 
  4. Enter a value for the Name field and click Save
  5. Click Conga Query Builder to access the Conga Query Builder.
  6. Select the lowest level object as the base object and then click Next.
    • The lowest level object in example report above is Opportunity, therefore Opportunity is selected as the base object in the Query Builder.
  7. Select all of the same fields referenced in the report and then click Next.
    • Use the directional arrows to move fields into the Selected Fields section. 
  8. Enter selection criteria that match the same filters on the report and click Next.
    • In the example above, Account ID equals "" is the only filter in the report. This filter functions as pv0 and dynamically filters the report by the specific Account record that a user initiates the Trigger solution on. To match the report's filter criteria, the Conga Query's selection criteria is to Account ID equals [null] as depicted below.
    • For more information about pv0 and using Conga Query filters, see Dynamically Filter Reports and Queries with pv values.
  9. Enter sample data values that fulfill the query criteria in the pv fields and click Preview.
    • This ensures that the results returned from the query match the results of the report. Clicking the Preview button runs the query and shows the retrieved data. 
    •  In this example, an Account ID is used as a sample for pv0. The specific Account record successfully returns 5 related opportunities upon clicking the Preview button. 
    • It is highly recommended to use the same criteria, such as a record Id, to test that the report and query both return the same results. 
      • To test the report in our example, the same sample Account Id used to test the query is inserted in the report's pv0 filter. 
      • The report and Conga Query must return the same results as demonstrated above.
  10. Click Save in the Conga Query Builder to save the query as a new Conga Query record.
  11. Repeat Steps 1-10 for each report used to gather data for a Trigger solution. 

Update Merge Field Syntax in the Template

After creating a Conga Query that returns the same results as the existing report, users must update the merge fields in Conga Template. It is recommended to first update the Conga Trigger solution's corresponding Conga Composer button to obtain the new merge field syntax and test the updated template.

For more information on a Conga Trigger solution's corresponding Composer button, see Convert a Conga Composer Button to a Formula Field Using the Conga Formula Builder and Edit a Conga Composer Button and Formula Field Using the Formula Builder

  1. Copy the Conga Query's 15 digit record Id from the browser URL.
  2. Click the Conga Workflow Formula Builder tab.
  3. Select the Master Object that Trigger formula field lives on and then select the Composer button that corresponds to the Trigger formula field.
  4. Click Edit Button.
  5. Add the QueryID parameter and use the copied Conga Query record ID as the parameter value.
    • Use the same alias as the previous ReportID parameter. Keeping the same alias for the QueryID parameter prevents the query dataset from being renamed and results in less work when editing merge field syntax in the template. In the example above, the alias for the Query ID is Opportunities which was also the alias for the ReportID parameter.
    • If an existing alias for the ReportID parameter does not exist, choose and enter a new alias for the QueryID parameter value. 
  6. Remove the ReportID parameter from the Composer button URL and click Save.
  7. Navigate to a sample object record and click the recently edited Composer button to access the Composer user interface. 
  8. Click Tools & Settings in the Composer window and then click Template Builder.
  9. Click the + button next to the new query dataset to display all available merge fields. 
    • Use the directional arrows to select merge fields from the new dataset. 
  10. Copy and paste the merge field syntax into the template to replace the previous dataset's merge field syntax. 
    • If the same alias is used for the QueryID parameter, the TableStart:dataset syntax remains the same and does not require updating. In the example above, TableStart:Opportunities and TableEnd:Opportunities is the correct syntax for both the ReportID and QueryID parameter values. 
    • Although the report and query retrieve the same fields, merge field syntax produced from queries may differ than merge syntax produced from reports. Ensure that all merge fields produced from the query use the correct syntax taken directly from the Template Builder. 
  11. Save the new template file locally. 
  12. Click the Back arrow button in the Composer window.
  13. Navigate to the Local Template tab and click Select File to select the new template version with updated merge fields.
  14. Click Preview or Merge & Download to merge and download the local template
    • Ensure that all merge fields successfully merge data. 
  15. (Optional) Repeat Steps 1-14 for all new Conga Queries replacing reports.
  16. Click the Conga Templates tab.
  17. Click the Conga Template record(s) referenced in the Composer button and Conga Trigger formula field.
  18. Click Upload Files and upload the new template file to the existing Conga Template record. 

  If the Conga Trigger formula field was built manually (without the Formula Builder) and a corresponding Composer button does not exist, it is highly recommended to build a temporary Composer button to access the Template Builder. A temporary Composer button allows users to easily test and troubleshoot the modified template with the new merge field syntax. 

Update the Conga Trigger Formula Field

After confirming that data successfully populates in the corresponding Composer button, it is time to update the Conga Trigger formula field. 

  1. Click the Conga Workflow Formula Builder tab
  2. Select the Master Object that the Trigger formula field lives on and then select the Composer button that corresponds to the Trigger formula field.
  3. Click Update Field.
    • The formula field then updates with the new QueryID parameter(s)
  4. Test the Conga Trigger solution on a sample record to ensure that all data populates successfully in the output document.