Customize

Output PDF by Query

Summary

Generate and output a PDF file based on the template file and the query for records.

You can process more records compared to “Output PDF”. 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.

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. Add an Attachment field in the app you created, and prepare records so 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 PDF by Query.”

The output will take time, so a dialog will be displayed during the output processing. The action will be completed when the output is finished.

Parameters

Set Gusuku API Key, App, Search Condition, Template Record, Template Field, Output Destination, 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. Fields in tables cannot be selected.

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.

Output Destination

Select a method to output the generated PDF file.

  • Browser Tab: A new tab opens in the browser and is displayed there.
  • Download: Download it in your browser and save it to a file
    • If the user closes the browser tab before the action is completed, it will not be downloaded.
  • Attachment Field: Upload it to Kintone
    • At the time of upload, it has not yet been actually saved in any field. You can set the result of “Output PDF” by mapping fields such as “Add Record” and setting it as “=$1” to the attachment field.
  • Browser Tab and Attachment Field: A new tab opens in the browser displaying a PDF, and it is also uploaded to Kintone at the same time.
  • Download and Attachment Field: Download it in the browser while simultaneously uploading it to Kintone.

File Name

Enter a file name.

This name will be the default file name for saving files and the file name of the attachment field.

Precautions

  • Communication with gusuku’s server will occur, but IP address restrictions are not applied during this connection.

  • Data record retrieval is performed by the user set up in the Kintone connection settings on Customine or Deploit, not by the user executing customizations in the Kintone app. Please pay special attention to the differences in record viewing permissions. Records that are prohibited from viewing for users running the app may be obtained.

Restrictions

  • If the output destination includes “Browser Tab” or “Download,” the operation to open a tab from customization will be blocked if the pop-up blocker is enabled in the user’s browser settings. Selecting “Download” will also download the file in a separate tab, so if a pop-up blocker prevents the download, it will not occur. Please allow pop-ups in the browser settings.

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

  • “Output PDF by Query” has the following limitations: “Output PDF” 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 it is necessary to use the Kintone cursor API when retrieving records. For the limitations of the cursor API, refer to Cybozu’s documentation .