Displaying a List of Accounts Matching a String Using SOQL

Do you have Reporting?

This example will only work if you also have the Reporting add-on (with a valid license) installed on your instance.

For more information on Reporting, consult the Reporting for step-by-step guidesRecipes and Macro Reference.

This guide will show you how to display a list of accounts matching a chosen string using SOQL. This is achieved with the use of the SOQL Reporter macro and also the Reporting add-on.

Ingredients

Add-ons

Salesforce & Confluence Server Connector, Reporting

Platform

Server

Macros
Suppliers

Guide


  1. Create Report Table macro.

  2. Within the Report Table macro, create a SOQL Reporter macro.
    Edit the soql-reporter macro and enter the following in query field:

    Select Name,Owner.Name,CreatedDate from Account where Name like '%ted%'

    This SOQL query will search Salesforce.com for all Name entities in Accounts that contain the string "ted" and will also return the related Owner.Name and CreatedDate values as well. (You may want to change the string to something more suitable to your Salesforce.com instance.)

    For more information on SOQL, consult the Force.com SOQL and SOSL Reference pages.

  3. Back within the Report Table macro, create a Report Column macro, and give it a Title of "Name".
     
  4. Within the "Name" Report Column macro, create a Report Info macro.
    For the Key, enter "sf:Name".
     
  5. Now, create another Report Column macro within the Report Table macro and give it a Title of "Owner Name".
     
  6. Within the "Owner Name" Report Column macro, create another Report Info macro.
    For the Key, enter "sf:Owner.Name".

  7. Now, create the final Report Column macro within the Report Table macro and give it a Title of "Created".
     
  8. Within the "Created" Report Column macro, create another Report Info macro.
    For the Key, enter "sf:CreatedDate".

  9. You should have something that looks like this:

     

  10. Click Save and check the results. 



Notes

For more information on SOQL, consult the Force.com SOQL and SOSL Reference pages.


Result

You should have something that looks like this: