# Create record but table no data.

**URL:** https://forum.kintone.dev/t/create-record-but-table-no-data/197
**Category:** General
**Created:** [July 13, 2021, 9:14am UTC](https://forum.kintone.dev/t/create-record-but-table-no-data/197 "2021-07-13T09:14:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)
#### Post date: [July 13, 2021, 9:14am UTC](https://forum.kintone.dev/t/create-record-but-table-no-data/197/1 "2021-07-13T09:14:15Z")

</div>

Test create data to table

kintone.events.on(‘app.record.index.show’, function(event){  
let appId = event.appId;

var Data = new Array();

var Create = { ‘containerNo’: {  
‘value’: ‘approve’  
},  
‘Table’: {  
‘type’: ‘SUBTABLE’,  
‘value’: [  
{  
‘t\_No’: {  
‘type’: ‘SINGLE\_LINE\_TEXT’,  
‘value’: ‘abc’  
},  
‘t\_ProductCode’: {  
‘type’: ‘SINGLE\_LINE\_TEXT’,  
‘value’: ‘ABF’  
}  
}

]  
}  
}

Data.push(Create)

var Body = {  
“app”: AppId\_,  
“records”: Data  
}

console.log('Body : ’ + JSON.stringify(Body));

kintone.api(kintone.api.url(’/k/v1/records’, true), ‘POST’, Body, function(resp) {  
// success  
console.log('success : ’ + JSON.stringify(resp));  
// console.log(‘success’);  
}, function(error) {  
// error  
console.log(error);  
});

});

---

<div class="post-metadata">

### Author: ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)
#### Post date: [July 13, 2021, 11:15am UTC](https://forum.kintone.dev/t/create-record-but-table-no-data/197/2 "2021-07-13T11:15:35Z")

</div>

NewTum Channel, thanks for your question.

Could you elaborate on the question, as it is vague.  
It’s very hard for community members to debug your code when there is very limited context.

I understand you are trying to place data into a table, but here are some information you can share with us:

- On what page or event do you want the data to be created on?
- What result are you currently getting? If you are getting errors, please share.

---

<div class="post-metadata">

### Author: ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)
#### Post date: [July 13, 2021, 12:02pm UTC](https://forum.kintone.dev/t/create-record-but-table-no-data/197/3 "2021-07-13T12:02:45Z")

</div>

Dear William Sayama

I want to create a record with data in table form.

I can create a record, But no data in the table.

```
 ![](https://developer.kintone.io/hc/user_images/JivowaRU3kXMv6KqIBO7hA.png)

```

Do you have an example to create a record and have tables?

Rest API for javascript in kintone.

---

<div class="post-metadata">

### Author: ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)
#### Post date: [July 13, 2021, 8:53pm UTC](https://forum.kintone.dev/t/create-record-but-table-no-data/197/4 "2021-07-13T20:53:34Z")

</div>

Hello NewTum

The following is an example of inputting table data upon creating a record:

```
(function() {
'use strict';

kintone.events.on('app.record.create.show', function(event) {
// Create Rows
var newRow1 = createValue_('1', 'Hello this is Chris');
var newRow2 = createValue_('2', 'Good bye, Tom');

// Input Default Value in the Table
event.record.Table.value = [
newRow1,
newRow2
];
return event;
});

function createValue_(number, text) {
return {
'value': {
'Number': {
'type': 'NUMBER',
'value': number
},
'Message': {
'type': 'SINGLE_LINE_TEXT',
'value': text
}
}
};
}
})();

```

![](https://developer.kintone.io/hc/user_images/ZS6mc7d8IM3AtPtpNI88kQ.png)

**Kintone Developer Program - Retrieve and manipulate table data**  
[https://developer.kintone.io/hc/en-us/articles/115003081768-Retrieve-and-manipulate-table-data](https://forum.kintone.dev/hc/en-us/articles/115003081768-Retrieve-and-manipulate-table-data)
