Displaying Salesforce Accounts Matching a String

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 use the Salesforce Reporter macro to display a table listing Salesforce Accounts that match a specified string.

Ingredients

Add-ons

Connector for Salesforce.com and Confluence, Reporting

Platform

Macros
Suppliers


Step-By-Step Guide


  1. Create a Report Table macro and edit it so that Injected is checked:



  2. Within the Report Table macro, create a Salesforce Reporter macro.
    Edit it, and enter the (Salesforce) Object you would like to search in.
    For this example, let's enter "Account".

  3. Let's also filter the results. In this example, let's filter the results using the Industry field in Salesforce Accounts, by limiting to fields that contain the word "energy".
    In the condition field, enter "Industry=like:energy".
    For more information about using Conditions, consult the SalesForce.com Confluence Query Conditions.

  4. Now, within the Salesforce Reporter macro, create a Text Sort macro.
    Edit the Text Sort macro and enter "sf:Name" for the Key. (This uses the Salesforce.com Supplier.)
    It should look something like this:



  5. You should now have a set of macros that look like this:



  6. Now, back within the Report Table macro, and under the Salesforce Reporter macro, create a Report Column macro and give it a Title of "Industry".

  7. Within that Report Column macro, create a Report Info macro.
    For the Key, enter "sf:Industry".

  8. Now create another Report Column macro and give it a Title of "Name".

  9. Within that Report Column macro, create a HTML macro.
    Within the HTML macro, enter the following code:

     

    Here we are using Parameter Injection to provide the proper values for the Salesforce ID and Name to form a proper URL which is then hyperlinked when the user clicks on the Industry Name.
    This is also why we checked the Injected checkbox in Step 1, so that the resulting URL is properly rendered.

  10. Now, create another Report Column macro and give it a Title of "Created Date".

  11. Within that Report Column macro, create a Report Info macro.
    For the Key, enter "sf:CreatedDate".

  12. Create the final Report Column macro and give it a Title of "Last Modified Date".

  13. Within that Report Column macro, create another Report Info macro.
    For the Key, enter "sf:LastModifiedDate".

  14. You should now have something that looks like this in the editor:

     

  15. Do take note that your Salesforce instance may be different, so do change the values in order to make this example work for you, e.g. you may want to change the search condition from "energy" to something else that is more relatable to your Salesforce data.



Notes

For more information regarding Reporting keychains, consult the Understanding Key Concepts page and Supplier Keychains page.


Result

You should have something that looks like this: