Excel Spreadsheet Automation on Claude Compliance Data with the QUERY Formula

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

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

    The driver connects to Claude Compliance using a Compliance Access Key, the only supported authentication method. Set the following connection property:

    • APIKey: The Compliance Access Key you created.

    Creating a Compliance Access Key

    1. Enable the Compliance API for your organization.
    2. Sign in to claude.ai as a primary owner or organization owner and open Organization settings > API > Keys.
    3. Select Create Key and assign only the scopes your integration needs:
      • read:compliance_activities for Activities and the typed activity views.
      • read:compliance_org_data for organizations, roles, groups, and settings.
      • read:compliance_user_data for users, chats, files, projects, and downloads.
      • delete:compliance_user_data for the explicit Delete stored procedures.
    4. Create the key and copy it when it appears. The key starts with sk-ant-api01- and is shown only once.

    Optionally, set OrganizationUUID to limit organization-scoped views (such as OrganizationUsers and ComplianceRoles) to a single linked organization. If it is left empty, those views default to the first available organization and do not include data from all linked organizations.

  • 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 Claude Compliance data, such as OrganizationUuid.
  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 Projects WHERE OrganizationUuid = '"&B2&"'","APIKey="&B1&";Provider=ClaudeCompliance",B3)
    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 Claude Compliance to get started:

 Download Now

Learn more:

Claude Compliance Icon Excel Add-In for Claude Compliance

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

Use Excel to read Claude Compliance Activities, Chats, ChatMessages, CodeArtifacts, ComplianceRoles, Organizations, OrganizationUsers, Projects, etc. Perfect for mass imports / exports, data cleansing & de-duplication, Excel based data analysis, and more!