Skip to content

Field Model

FieldValue

General Field's value of the kintone app

Constructor

Parameter

(none)

Methods

getType()

get the type of field.

Parameter

(none)

Return

FieldType

Sample code

get the type of field. Source code
// execute GET RECORD API
Integer appID = 1;
Integer recordID =1;
GetRecordResponse response = kintoneRecordManager.getRecord(appID, recordID);

HashMap resultRecord = response.getRecord();
FieldValue fv = resultRecord.get("sample field");
FieldType fieldType = fv.getType();

setType(FieldType type)

set the type of field.

Parameter

Name type Description
type FieldType The type of field - kintone-sdk FieldType constants.

Return

(none)

Sample code

set the type of field. Source code
Integer appID = 1;
HashMap record = new HashMap();

FieldValue fv = new FieldValue();
fv.setType(FieldType.SINGLE_LINE_TEXT);
fv.setValue("sample_AddRecord");
record.put("FieldCode1", fv);

AddRecordResponse response = kintoneRecordManager.addRecord(appID, record);

getValue()

get the value of field in the record.

Parameter

(none)

Return

Object

Sample code

get the value of field in the record. Source code
// execute GET RECORD API
Integer appID = 1;
Integer recordID =1;
GetRecordResponse response = kintoneRecordManager.getRecord(appID, recordID);

HashMap resultRecord = response.getRecord();
FieldValue fv = resultRecord.get("sample field");
Object fieldValue = fv.getValue();

setValue(Object value)

set the value of field in the record.

Parameter

Name type Description
value Object The value of field in the record, read more at Field Type here.

Return

(none)

Sample code

set the value of field in the record. Source code
Integer appID = 1;
HashMap record = new HashMap();

FieldValue fv = new FieldValue();
fv.setType(FieldType.SINGLE_LINE_TEXT);
fv.setValue("sample_AddRecord");
record.put("FieldCode1", fv);

AddRecordResponse response = kintoneRecordManager.addRecord(appID, record);

SubTableValueItem

Constructor

Parameter

(none)

Methods

getID()

get the ID of item in table.

Parameter

(none)

Return

Integer

Sample code

get the ID of item in table. Source code
// execute GET RECORD API
Integer appID = 1;
Integer recordID =1;
GetRecordResponse response = kintoneRecordManager.getRecord(appID, recordID);

HashMap resultRecord = response.getRecord();
FieldValue fv = resultRecord.get("SubTable field");
Object fieldValue = fv.getValue();
ArrayList subTable = (ArrayList)fieldValue;
Integer itemID = subTable.get(0).getID();

setID(Integer id)

set the ID of table.

Parameter

Name type Description
id Integer The ID of table .

Return

(none)

Sample code

set the ID of item in table. Source code
SubTableValueItem tableItem = new SubTableValueItem();
tableItem.setID(00000);
HashMap tableItemValue = new HashMap();
FieldValue fv1 = new FieldValue();
fv1.setType(FieldType.SINGLE_LINE_TEXT);
fv1.setValue("sample_text1");
FieldValue fv2 = new FieldValue();
fv2.setType(FieldType.SINGLE_LINE_TEXT);
fv2.setValue("sample_text2");
tableItemValue.put("sample field1", fv1);
tableItemValue.put("sample field2", fv2);
tableItem.setValue(tableItemValue);  

getValue()

get the value of field in the record.

Parameter

(none)

Return

HashMap<String, FieldValue>

Sample code

get the ID of item in table. Source code
// execute GET RECORD API
Integer appID = 1;
Integer recordID =1;
GetRecordResponse response = kintoneRecordManager.getRecord(appID, recordID);

HashMap resultRecord = response.getRecord();
FieldValue fv = resultRecord.get("SubTable field");
Object fieldValue = fv.getValue();
ArrayList subTable = (ArrayList)fieldValue;
HashMap itemValue= subTable.get(0).getValue();

setValue(HashMap<String, FieldValue> value)

set the value of field in the record.

Parameter

Name type Description
value HashMap<String, FieldValue> The row data of table.

Return

(none)

Sample code

get the ID of item in table. Source code
SubTableValueItem tableItem = new SubTableValueItem();
tableItem.setID(00000);
HashMap tableItemValue = new HashMap();
FieldValue fv1 = new FieldValue();
fv1.setType(FieldType.SINGLE_LINE_TEXT);
fv1.setValue("sample_text1");
FieldValue fv2 = new FieldValue();
fv2.setType(FieldType.SINGLE_LINE_TEXT);
fv2.setValue("sample_text2");
tableItemValue.put("sample field1", fv1);
tableItemValue.put("sample field2", fv2);
tableItem.setValue(tableItemValue);