Retrieve Record Data (Record Details)

To Start Off

This tutorial will guide you on how to retrieve values from a record in your Kintone record details page.

Step 1. Retrieve Record ID value

We will first retrieve the Record ID of the current record initiated by a button click. 
Record IDs are the key IDs for each record in an app, that starts from 1. We will use the function of to retrieve the Record ID. Check the Get Record article for more details of the API. 
Below is a sample code for retrieving and displaying the Record ID.

Save the code as a JavaScript file, and upload it to your app.
A button should appear on the record details page. Click it to retrieve and display the record ID of the record you are viewing.


Step 2. Retrieve record value

The function we will use here will be For mobile, use instead.
The returned value will be in a JSON format, and null will be returned in case of errors.

A sample code can be written as follows:


You will need to replace field_code with the field code of your field that you want to retrieve the value from. Field codes can be checked and updated from the app settings menu.
Navigate through to Edit Form > (Hover over a field already set in the canvas) > Settings > Field Code





The following sample code will display the value from the Updated datetime field on a Blank space field, by clicking a button.

You will need to place a Blank space field into your app's form, and name the Element ID "my_space_field" in the Blank space field's settings. The Add Buttons (Record Details) tutorial shows how to set your Blank space field's settings.

Note: There are several ways you can write your JavaScript code to retrieve values from the returned object. Use the below code as reference.

Step 3. Field type and format

After applying the JavaScript code, and clicking on the button on the record details page, check the value that is displayed on the Blank space field.



You may have noticed that the date formats in the Blank space field and the Updated datetime field are different.
Make sure you check the Field Types and Date Formats pages as formats of data displayed on HTML and data retrieved by API may look different.

Step 4. Be careful when using

Check the notes written about the API.



Due to this, the following code will be incorrect, and will not work.

Step 5. The event object

The previous samples returns an Event object.




To understand the event object more, let's check back on the Record Details Event page.
The property information of the event object is listed in the page.



Notice that the event object already has the same return value as the values obtained with

Step 6. Retrieving record values from the event object

The below sample will retrieve the value of the Updated datetime field from the event object instead of using


We hope you enjoyed learning how to retrieve record data by the Kintone JavaScript API and have a good understanding of the event object.
Let's move to the next tutorials!

Was this article helpful?
1 out of 1 found this helpful
Do you have any questions or issues related to this article?
Please share your views with us in the Community forums!