Excel Spreadsheet Automation on Talkdesk Data with the QUERY Formula

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

The CData Excel Add-In for Talkdesk provides formulas that can query Talkdesk data. The following three steps show how you can automate the following task: Search Talkdesk 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 Talkdesk data records you want to retrieve, written in standard SQL.
  • Connection: Either the connection name, such as TalkdeskConnection1, or a connection string. The connection string consists of the required properties for connecting to Talkdesk data, separated by semicolons.

    Talkdesk uses the OAuth 2.0 Client Credentials grant. There is no browser-based authorization step and no callback URL.

    Set the following connection properties:

    • AccountName: The name of your Talkdesk account.
    • Region: The region where your Talkdesk instance is deployed. Supported values are US (default), EU, CA, AU, UK, and FedRamp.
    • OAuthClientId: The Client Id assigned when you registered your custom OAuth application.
    • OAuthClientSecret: The Client Secret assigned to your custom OAuth application.

    Creating a Custom OAuth Application

    1. Log in to your Talkdesk account and select OAuth Clients from the navigation menu.
    2. Click Create OAuth Client and give the client a descriptive name.
    3. Set Grant Type to Client Credentials.
    4. Click Add scopes and select the scopes for the data you want to access.
    5. Click Create and copy the Client Id and Client Secret.

    When you connect, the driver automatically requests an access token from Talkdesk, caches it, and refreshes it when it expires. Make sure the scopes selected for the application match the views you plan to query, or the token request can fail.

  • 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 Talkdesk data, such as Active.
  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 Users WHERE Active = '"&B5&"'","AccountName="&B1&";Region="&B2&";OAuthClientId="&B3&";OAuthClientSecret="&B4&";Provider=Talkdesk",B6)
    Formula inputs used in this example. (Google Apps is shown.)
  4. Change the filter to change the data. The outputs of the formula. (Google Apps is shown.)

Ready to get started?

Download a free trial of the Excel Add-In for Talkdesk to get started:

 Download Now

Learn more:

Talkdesk Icon Excel Add-In for Talkdesk

The Talkdesk Excel Add-In is a powerful tool that allows you to connect with live Talkdesk data, directly from Microsoft Excel.

Use Excel to read Talkdesk Accounts, Attributes, BillingAccounts, Callbacks, Campaigns, Cases, Contacts, GuardianUsers, Invoices, Products, Subscriptions, Teams, Users, Wallets, etc. Perfect for mass imports / exports, data cleansing & de-duplication, Excel based data analysis, and more!