Job Runner

Output Excel by Query

Summary

Generate and output an Excel file based on the template file and the query for records.

You can process more records compared to “Output Excel”. Instead, there will be many Restrictions.

How to Use

Some preparations are necessary in advance.

You will need the API key for gusuku. This API key is different from the API token of the Kintone app. The API key for gusuku can be issued and obtained from gusuku Admin.

You need to prepare a template file. For information on how to create a template file, see Excel/PDF Output Template Reference Manual.

In addition, a Kintone app is also needed to save the template. I will set up an attachment file field in the created app and create records so that there is one record per template in this field.

In Customine customization, you retrieve records that have saved the templates to be applied, and set parameters such as queries to obtain templates and output records with “Output Excel by Query.”

The generated Excel file will be in an uploaded state to Kintone. By using field mapping such as “Add Record”, you can set the result of “Export to Excel” by setting it as “=$1” in the attachment field.

Parameter

Set Gusuku API Key, App, Search Condition, Template Record, Template Field, Charset, and File Name.

Gusuku API Key

Specify the API key for gusuku.

Please note that this is not about the API token of the Kintone app.

App

Select which app to retrieve the data you want to output from.

Search Condition

Enter the search criteria (query) to obtain the data you want to output.

It is also possible to set the condition to “All records.”

You can choose the order, but processing may be quicker if you do not specify it. If not specified, it will be in ascending order of record ID.

Template Record

Select the record containing the template file.

If there are no selected records at runtime, it will result in an error.

Template Field

Select the Attachment field in the “Template Record” that contains the template file.

Only Attachment field can be selected. This parameter does not accept fields that are inside tables.

If no files are attached in the Attachment field, an error will occur at runtime.

The file extension of the attached file must be .xlsx. If the file’s extension is other than that, an error will occur at runtime.

File Name

Enter the file name to attach to the attachment field.

Precautions

  • Data record retrieval is performed by the user set up in the Kintone connection settings on Customine or Deploit, not by the Kintone app’s API token.

Restrictions

  • If the output process does not finish within 10 minutes, it will result in an error.

  • “Output Excel by Query” has the following limitations: “Output Excel” doesn’t have.

    • Records cannot be processed with Customine before outputting.
    • Accessing records by specifying numbers and slices is not supported. For example, you cannot express something like output only the first ten lines ($FOREACH(0..9).)
    • If there is a sort order specified in the search criteria, and the template is using Sheet Expansion, the expanded sheet cannot use Metadata.
    • If you specify the order in the search conditions, you cannot execute “Output Excel/PDF/CSV by Query” more than 10 at the same time. If no order is specified, there are no restrictions.
      • The reason for this restriction is that the Kintone cursor API is used when retrieving records. For the limitations of the cursor API, refer to Cybozu’s documentation .