Excel Spreadsheet Automation with the QUERY Formula



Pull data, automate spreadsheets, and more with the QUERY formula.

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

    In addition to the authentication values, set the following parameters to connect to and retrieve data from Kintone:

    • Url: The URL of your account.
    • GuestSpaceId: Optional. Set this when using a guest space.

    Authenticating with Kintone

    Kintone supports the following authentication methods.

    Using Password Authentication

    You must set the following to authenticate:

    • User: The username of your account.
    • Password: The password of your account.

    Using Basic Authentication

    If the basic authentication security feature is set on the domain, supply the additional login credentials with BasicAuthUser and BasicAuthPassword. Basic authentication requires these credentials in addition to User and Password.

    Using Client SSL

    Instead of basic authentication, you can specify a client certificate to authenticate. Set SSLClientCert, SSLClientCertType, SSLClientCertSubject, and SSLClientCertPassword. Additionally, set User and Password to your login credentials.

  • 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 Kintone data, such as AppId.
  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 Comments WHERE AppId = '"&B5&"'","User="&B1&";Password="&B2&";Url="&B3&";GuestSpaceId="&B4&";Provider=Kintone",B6)
  4. Change the filter to change the data.

Ready to get started?

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

 Download Now

Learn more:

Kintone  Icon Excel Add-In for Kintone

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

Use Excel to read, write, and update Kintone applications and databases. Perfect for mass imports / exports / updates, data cleansing & de-duplication, Excel based data analysis, and more!