How to Attach Scripts to Kintone Apps

Contents

Overview

This article introduces how to attach JavaScript files to Kintone Apps. The attached scripts will automatically run for any page containing the App's data. Scripts can help the overall user experience when interacting with Kintone Apps.

Run JavaScript files on Kintone Apps

Create the Script

Prepare the following code in a local text editor. Save it as a JavaScript file.

1
2
3
4
(function() {
  'use strict';
  console.log('Hello kintone');
})();

Upload the Script to the App

Navigate to a Kintone App of your choice, or create a new App (External link) . Access the App's settings, and navigate to the JavaScript and CSS Customization option. Find the Upload JavaScript for PC option, and click on Add File. Select the JavaScript file that was made earlier. Click on Save and Update the App's settings. For more information, refer to the Kintone Help Documents (External link) .

Run the Script

Navigate to any page of the App that contains data, such as the Record List view. Open the developer console of the browser. The script should have run and outputted a message into the console.

Things to take note of

Permissions are needed

Only users who are Kintone administrators (External link) are able to upload JavaScript files to Apps. For other users, the settings will be greyed out.

Scripts can be re-uploaded

To re-upload a script, navigate to the JavaScript and CSS Customization option. Delete the file currently uploaded to the App. After that, re-upload the newly updated script.

Multiple scripts can be added

Multiple files can be uploaded to the same App. Scripts will run in order from the top. If any libraries are being used, make sure they are listed at the top of the list.