Insert Row Numbers Into Tables
Contents
Overview
This article introduces how to automatically insert row numbers into tables when the record is saved.
Sample Image
An event is triggered when the user navigates to the Record create page, navigates to the Record edit page, or makes changes to the Table field. This disables the Number field. An event is also triggered when the record is saved. The number of rows in the Table field is calculated, and the Number field is automatically filled in with row numbers.
Prepare the App
Create an App with the following fields and settings.
Field Type | Field Name | Field Code | Notes |
---|---|---|---|
Table | User List | usertable | See the table below for the fields to place inside. |
Set the following fields and settings for the User List table.
Field Type | Field Name | Field Code |
---|---|---|
Number | Row Number | row_number |
Text | Name | name |
Sample Code
Prepare the following JavaScript code in a text editor and navigate to the Kintone App's settings. Upload the file into the Upload JavaScript for PC option of the JavaScript and CSS Customization settings .
|
|
After saving the settings and clicking on Update App, create a new record. Add new rows into the table, and fill it with data. After saving the record, the Number field of the table should automatically be numbered, starting with the number 1.