# table.onRecordAdd
Listen to the record adding event and return a function to cancel the listener.

## Permission Requirements
**Notice**：Enable any of the following permissions
View, comment, edit and manage multidimensional tables(bitable:app)
View, comment and export multidimensional tables(bitable:app:readonly)

## input
```
onRecordAdd((event) => {})
```

name | Data Type | Required | Description
---|---|---|---
event | ```js<br>{<br>"name": string,<br>"type": "publish",<br>"data": string[],<br>} | No | data is the new recordId array

## output
Function to unlisten.
## sample code

```js
     const selection = await bitable. base. getSelection();
     const table = await bitable.base.getTableById(selection.tableId);

const field = await table.getFieldByName('multi-line text') // get the field of multi-line text type according to the field name
     const off = table.onRecordAdd((event) => { // Listen to the field increase event.
         off();
         console.log('event:', event);
     })

table.addRecord({ // Add a new row of records.
         fields: {
             [field.id]: [{
                 type: 'text',
                 text: 'New record'
             }]
         }
     })
```