Although Kintone Apps allow data to be exported as CSV files, there are no options to export data as Excel files.
This article introduces a method to output data as an Excel file directly from Kintone with the click of a button.
Completed customization image
The data in the Kintone App is outputted to an Excel file by clicking a button under the Record View list.
Preparing the App
Create an App from scratch
From the Kintone portal, click the [+] icon within the Apps widget.
Then click Create App from Scratch to create a new Kintone App.
Add the following fields to the App form.
Change the settings for each field as shown below.
|Field type||Field name||Field code|
|Record number||Record number||Record_number|
Custom view settings
Next, navigate to the Views tab. Click the [+] button to create a new view.
Select Custom view as the display format of the record view.
Enter the following code in the HTML code box.
Click the Save button, and then click Activate App to create the App.
- Lines 132-136: Creates data for output when the app.record.index.show event is triggered as the page loads
- Lines 33-47: Uses the function fetchRecords() to retrieve all Kintone records.
- Lines 22-31: Creates an element from the retrieved data.
- Lines 105-117: Creates an HTML table from the element.
- Lines 61-86: Uses methods from several libraries introduced later on to export from tables to xlsx at the timing of clicking the button.
Libraries within the Kintone CDN: Specify by URL
Libraries outside the Kintone CDN: Download from GitHub and upload as a file
- SheetJS js-xlsx
- Apache License 2.0
- FileSaver.min.js v1.3.4
- MIT License
Once all files have been uploaded, the settings should look like the following.
Checking the customization
When viewing the custom list view, the Download XLSX button should appear. Clicking the button should output the Kintone data in xlsx format.
This article introduced a method to output Kintone record data directly into an xlsx file, instead of converting from CSV to xlsx. This method of outputting directly to an xlsx file makes it easier to integrate with services that can read Excel files.