Get Record

Get Record IDkintone.app.record.getId

Retrieves the Record ID of the currently open record.

Function

kintone.app.record.getId

Parameters

none

Response

  • Number or null
  • Null is returned for pages where it cannot be used.

Sample

    var recordId= kintone.app.record.getId();
    console.log(recordId);

Available Pages

  • Record Details
  • Record Edit

Get Record Detailskintone.app.record.get

Retrieves record data of the currently open record in JSON format.

Function

Desktop
kintone.app.record.get
Smartphone
kintone.mobile.app.record.get

Parameters

None

Response

  • An object with record details, or null.
  • Null is returned for pages where it cannot be used.
  • If the API is used on the Record Create or Record Edit page, the returned data will include the current edited data.

Sample

    var record = kintone.app.record.get();
    console.log(record);
    
    // Sample Response
    // {
    //     "record": {
    //         "updated_time": {
    //             "type": "UPDATED_TIME",
    //             "value": "2015-04-15T09:22:00Z"
    //         },
    //         "creator": {
    //             "type": "CREATOR",
    //             "value": {
    //                 "code": "john-d",
    //                 "name": "John Doe"
    //             }
    //         },
    //         "radiobutton_0": {
    //             "type": "RADIO_BUTTON",
    //             "value": "January"
    //         },
    //         "created_time": {
    //             "type": "CREATED_TIME",
    //             "value": "2015-04-15T09:22:00Z"
    //         },
    //         "record_id": {
    //             "type": "RECORD_NUMBER",
    //             "value": "1"
    //         },
    //         "updater": {
    //             "type": "MODIFIER",
    //             "value": {
    //                 "code": "john-d",
    //                 "name": "John Doe"
    //             }
    //         },
    //         "checkbox": {
    //             "type": "CHECK_BOX",
    //             "value": [
    //                 "Sunday",
    //                 "Monday"
    //             ]
    //         }
    //     }
    // }

Available Pages

  • Record Details
  • Record Create
  • Record Edit

Notes

  • kintone.app.record.get and kintone.mobile.app.record.get cannot be called in the kintone.events.on handler.If you need to retrieve record data in the event handler, utilize the event object, as that has the record data inside.

Get Record Field Elementkintone.app.record.getFieldElement

Retrieves the field element of a field in the record, by specifying the field code.

Function

kintone.app.record.getFieldElement

Parameters

PARAMETER VALUE REQUIRED DESCRIPTION
fieldCode String Yes Specify the field code of the field you want to retrieve.

Response

  • A string of field elements, or null.
  • Null is returned for pages where it cannot be used.

Sample

    kintone.app.record.getFieldElement('record_id');

Available Pages

  • Record Details
    (Cannot be called on the Record edit/create page, or the notification page)

Notes

  • The retrieval of data and the DOM's style is supported
  • Changing the internal structure of the DOM may lead to features not functioning correctly after a kintone update.
  • The following fields cannot be retrieved, and null will be returned
    • Status
    • Assignee
    • Fields within tables
    • Fields within the Related records
    • Field group
  • Null will be returned if you specify a field you have no access to.

Set Record Valuekintone.app.record.set

Places values inside fields of the record that is currently being edited.

Function

Desktop
kintone.app.record.set
Smartphone
kintone.mobile.app.record.set

Parameters

PARAMETER VALUE REQUIRED DESCRIPTION
record JSON Yes Specify the record data as JSON. (The format is the same as the response for kintone.app.record.get.

Response

None

Sample

    var record = kintone.app.record.get();
    record['record']['single_text_field']['value'] = 'new content!';
    kintone.app.record.set(record);

Available Pages

  • Record Create
  • Record Edit

Notes

  • kintone.app.record.set and kintone.mobile.app.record.set cannot be called in the kintone.events.on handler.If you need to retrieve record data in the event handler, utilize the event object, as that has the record data inside.

Get Record Header Menu Elementkintone.app.record.getHeaderMenuSpaceElement

Retrieves the empty space element of the header of the record, i.e. the space highlighted in the below image.
 

Function

kintone.app.record.getHeaderMenuSpaceElement

Parameters

None

Response

  • The space element of the header.
  • Null is returned for pages where it cannot be used.

Sample

    var el = kintone.app.record.getHeaderMenuSpaceElement();

Available Pages

  • Record Details
  • Record Create
  • Record Edit

Notes

  • The visual aspect of this element may change unexpectedly, ass the stylesheet of kintone takes effect on it.
  • We do not recommend the following changes, as kintone may function unexpectedly when clicked:
    • adding INPUT elements with TYPE attributes of "submit"
    • adding BUTTON elements to empty elements

Get Space Elementkintone.app.record.getSpaceElement

Retrieves the element of a Blank space field that you have placed inside your record form.

Function

kintone.app.record.getSpaceElement

Parameters

PARAMETER VALUE REQUIRED DESCRIPTION
id String Yes The element ID of the Blank space field. When you place a Blank space field inside your app form, you can assign an element ID through the field's option.

Response

  • The element of the specified Space field.
  • Null is returned if the specified Space field does not exist.
  • Null is returned for pages where it cannot be used.

Sample

    var el = kintone.app.record.getSpaceElement('space1');

Available Pages

  • Record Details
  • Record Create
  • Record Edit

Get Related Records Targetkintone.app.getRelatedRecordsTargetAppId

Retrieves the App ID of the Datasource app of the specified Related records field, in the record.

Function

kintone.app.getRelatedRecordsTargetAppId

Parameters

PARAMETER VALUE REQUIRED DESCRIPTION
fieldCode String Yes Specify the field code of the Related records field.

Response

  • The App ID or null.
  • Null is returned for the following cases:
    • The specified field does not exist.
    • The specified field cannot be viewed.
    • The specified field is not a Related records field.

Sample

    var related = kintone.app.getRelatedRecordsTargetAppId('reference');

Available Pages

  • Record List
  • Record Create
  • Record Edit
  • Record Details
  • Graph
  • File Import
  • File Export
  • Record Print

Notes

  • As long as you have permission to view the specified field, you can retrieve the datasource App ID even if you don't have access to view the data in the datasource app.

Get Lookup Targetkintone.app.getLookupTargetAppId()

Retrieves the App ID of the Datasource app of the specified Lookup field, in the record.

Function

kintone.app.getLookupTargetAppId(fieldCode)

Parameters

PARAMETER VALUE REQUIRED DESCRIPTION
fieldCode String Yes Specify the field code of the Lookup field.

Response

  • The App ID or null.
  • Null is returned for the following cases:
    • The specified field does not exist.
    • The specified field cannot be viewed.
    • The specified field is not a Lookup field.

Sample

    var related = kintone.app.getLookupTargetAppId('reference');

Available Pages

  • Record List
  • Record Create
  • Record Edit
  • Record Details
  • Graph
  • File Import
  • File Export
  • Record Print

Notes

  • As long as you have permission to view the specified field, you can retrieve the datasource App ID even if you don't have access to view the data in the datasource app.

Get Mobile Header Element kintone.mobile.app.getHeaderSpaceElement

Retrieves the empty space element below the header of the record for smartphones, i.e. the space highlighted in the below image.

Function

kintone.mobile.app.getHeaderSpaceElement

Parameters

None

Response

  • The element of the empty space element below the header of the record is returned.
  • Null is returned for pages where it cannot be used.

Sample

    var el = kintone.mobile.app.getHeaderSpaceElement();

Available Pages

  • Record List
  • Record Details
  • Record Create
  • Record Edit
Was this article helpful?
0 out of 0 found this helpful
Comments
Please sign in to leave a comment.