Excel Spreadsheet Automation on Vercel Data with the QUERY Formula

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

The CData Excel Add-In for Vercel provides formulas that can query Vercel data. The following three steps show how you can automate the following task: Search Vercel 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 Vercel 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 Vercel data, separated by semicolons.

    Using API Key Authentication

    Vercel uses Bearer token authentication. You can use either a personal access token or an OAuth access token as the API key.

    To obtain a personal access token:

    1. Log into your Vercel account at https://vercel.com/
    2. Navigate to Account Settings > Tokens.
    3. Click Create Token, enter a name and expiration, and click Create.
    4. Copy the generated token (it will only be shown once).

    After obtaining your token, set the following connection properties:

    • AuthScheme: Set this to APIKey.
    • APIKey: Set this to your Vercel personal access token or OAuth access token.

    Example Connection String

    Profile=C:\profiles\Vercel.apip;AuthScheme=APIKey;APIKey=your_access_token;
    

    Working with Teams

    Many Vercel resources are scoped to a team. To scope all requests to a specific team, set the TeamId connection property to your team's ID. You can find your team ID by querying the Teams table or from the Vercel dashboard. Alternatively, you can specify TeamId in your SQL queries using the WHERE clause where supported.

    Connecting to Vercel

    Once the authentication is configured, you can connect to Vercel and query data from any of the available tables such as Projects, Deployments, Teams, and Domains.

  • 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 Vercel 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 User WHERE  = '"&B4&"'","Profile="&B1&";AuthScheme="&B2&";APIKey="&B3&";Provider=API",B5)
  4. Change the filter to change the data.

Ready to get started?

Connect to live data from Vercel with the API Driver

Connect to Vercel