Due to the almost unlimited customizability of SOQL statements, Technical Support Team will only support SOQL queries generated through Conga Query Builder or written by following one of our support articles. The technical Support Team does not support custom-written queries.

Use Conga Queries and SOQL statements to merge Salesforce data into your documents. Conga Queries are used any time you need to access child object data or need to access data that is not on your master object. See About Conga Query Manager for more information.

To create a Conga Query

  1. Navigate to the Conga Queries tab.
  2. Click New to create a new Conga Query record.
  3. Type a Name and Description.
  4. Leave the SOQL Select Statement field blank.

    If you already have a SOQL query, you can enter it into the SOQL Select Statement field.
  5. Click Save.
  6. Click Conga Query Builder.
    • In Lightning, click the Conga Query Builder button. You may have to select the dropdown in the right-hand corner to see the button:

    • In Classic, click the Conga Query Builder button to launch the Query Builder.

  7. Click an object in the list to select it as the base object of your query. The object should be the lowest level object in your data structure.
    For example: If you are querying for Opportunity Line Items but your button is on the Account, the lowest level object would be Opportunity Line Items (Opportunity Product). You would select that object on this screen.

  8. Click Next.
  9. Click on the fields you want to display and click >> to move them to the Selected Fields area. Click the headers to access additional fields.
  10. Click Next.
  11. Set the Field dropdown to the ID of the object where your button resides.
  12. Set the Operator dropdown to equals and leave the Value field blank.

    You can specify additional selection criteria if needed.

  13. (Optional) Choose a sort order and number of rows to display.
  14. Click Next.
  15. On the resulting page, you see your SOQL statement.

    You can also test your query from this page.
  16. (Optional) To test your query, enter the Salesforce ID of an appropriate record into the pv0, pv1, pv2, pv3, or pv4 fields and click Preview.
    The information is displayed in a pop-up window so make sure you have any pop-up blockers disabled or have set your browser to allow pop-ups from Salesforce.
  17. When you have completed testing, click Save.
If you manually edit the SOQL query generated by the Query Builder, do not use the Query Builder again for that record because your edits will be overwritten.

Example

Let's say you want to display a list of related contacts from an Account in your generated document. To create that query you would:

  1. Open the Conga Queries tab.
  2. Click New.
  3. Fill in Query record information:
    1. Name: "Account Contacts"
    2. Description: "Gather contact information for accounts"
  4. Leave both the SOQL Select Statement fields and the Key field blank.
  5. Click Save.
  6. Click Conga Query Builder.
  7. Select Contact.
  8. Click Next.
  9. Select the following fields and click >> to move them to the Selected Fields area.
    • Business Phone
    • First Name
    • Last Name
    • Title.
  10. Click Next.
  11. Set the Field dropdown to Account ID.
  12. Set the Operator dropdown to "equals".
  13. Leave the Value field blank.
  14. Click Next. The SOQL statement should display: SELECT Phone, FirstName, LastName, Title FROM Contact WHERE AccountId = '{pv0}' 
  15. (Optional) To test the query, enter an Account ID in the pv0 field and click Preview. In the pop-up window, you should see up to 20 rows of contacts associated with the specific Account ID.
  16. Click Save.