Customize

Output CSV

Summary

Generate and output a CSV file based on the template file and record data.

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 the Customine customization, create a customization that retrieves records that can save the templates to apply and records that will output data.

Finally, set up “Output CSV” within the customization and set the template and output records as parameters.

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

If multiple sheets are in the template, only the active sheet (the sheet that was open when saving the Excel file) will be output.

Parameters

Set Gusuku API Key, Data Record, Template Record, Template Field, Charset, 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.

Data Record

Select the records that will be the output data.

If omitted, the record of the screen currently open by the user will be the data record. When in the list view, the records displayed on the current page of the list are targeted, while in the record details or edit view, only one record is targeted. However, it cannot be omitted to specify in the calendar view.

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.

Charset

Select the character encoding for the output CSV file.

If you select UTF-8, it will be in the without BOM format. This format will cause garbled characters when you open the output file in Excel by double-clicking. To open the file in this format with Excel, you must first launch it with a new file and import it using Excel’s “Import External Data” feature.

Output Destination

Select a method to output the generated CSV file.

  • 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 CSV” by mapping fields such as “Add Record” and setting it as “=$1” to the attachment field.
  • 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.

Restrictions

  • Content not expressed in the CSV file, such as figures, images, and cell formatting, will be lost during output.

  • If the output destination contains “Download”, the download will be performed in a separate tab of the browser. Therefore, if the pop-up blocker is enabled in the user’s browser settings, the operation to open tabs from customization will be blocked, and downloads cannot be performed. In that situation, pop-ups should be permitted in the browser settings.

  • If the size of “Data Record” exceeds approximately 50MB, an error will occur.

  • Passing the records obtained with “Retrieve Table Rows as Records” to “Data Record” results in an error.

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