Excel Spreadsheet Automation on Gong Data with the QUERY Formula

Jerod Johnson
Jerod Johnson
Director, Technology Evangelism
Pull data from Gong, automate spreadsheets, and more with the QUERY formula.

The CData Excel Add-In for Gong provides formulas that can query Gong data. The following three steps show how you can automate the following task: Search Gong data for a user-specified value and then organize the results into an Excel spreadsheet.

The syntax of the CDATAQUERY formula is the following:

=CDATAQUERY(Query, [Connection], [Parameters], [ResultLocation]);

This formula requires three inputs:

  • Query: The declaration of the Gong data records you want to retrieve, written in standard SQL.
  • Connection: Either the connection name, such as APIConnection1, or a connection string. The connection string consists of the required properties for connecting to Gong data, separated by semicolons.

    To authenticate to Gong, you can use API Key authentication with your Gong API Key and API Secret.

    Authentication

    To authenticate to Gong, you must provide your Gong API Key and API Secret, along with your tenant Domain. These credentials are combined and Base64-encoded to form the Basic authentication header used for all API requests.

    Using API Key Authentication

    To authenticate using an API Key, you need to obtain your API Key and API Secret from your Gong account settings.

    You can then connect by setting the AuthScheme to APIKey and providing your credentials:

    • AuthScheme: Set this to APIKey.
    • APIKey: Set this to your Gong API Key.
    • APISecret: Set this to your Gong API Secret.
    • Domain: Set this to your Gong tenant domain (e.g., us-36533.api.gong.io).

    Example connection string

    Profile=C:\profiles\Gong.apip;AuthScheme=APIKey;ProfileSettings='APIKey=your_api_key;APISecret=your_api_secret;Domain=your-tenant.api.gong.io';
    
  • ResultLocation: The cell that the output of results should start from.

Pass Spreadsheet Cells as Inputs to the Query

The procedure below results in a spreadsheet that organizes all the formula inputs in the first column.

  1. Define cells for the formula inputs. In addition to the connection inputs, add another input to define a criterion for a filter to be used to search Gong data, such as .
  2. In another cell, write the formula, referencing the cell values from the user input cells defined above. Single quotes are used to enclose values such as addresses that may contain spaces.
  3. =CDATAQUERY("SELECT * FROM AnsweredScorecards WHERE  = '"&B7&"'","Profile="&B1&";AuthScheme="&B2&";ProfileSettings="&B3&";APISecret="&B4&";Domain="&B5&";Provider=API",B8)
  4. Change the filter to change the data.

Ready to get started?

Connect to live data from Gong with the API Driver

Connect to Gong