Javacript batchAppend

Your Setup:

  • Seatable cloud

Describe the Problem/Error/Question:

I am trying to use batch calls rather than for loops to create new rows. I am calling the JavaScript internally (using a button). The code works well except that I run into an issue with using base.batchAppendRows . I have actually run into another issue trying to use batchDelete.

I can’t find any documentation saying that base.batch is deprecated, and the current user manual still shows them as available functions.

Error Messages:

Error: base.batchAppendRows is not a function. (In ‘base.batchAppendRows(‘PedidoItems’, orderItemRows, applyDefault = true)’, ‘base.batchAppendRows’ is undefined)

// 3. Batch append (no return value)
await base.batchAppendRows('PedidoItems', orderItemRows, applyDefault = true);

If I look at the available functions this is the response I get (doesn’t have batchAppend)

console.log(Object.getOwnPropertyNames(Object.getPrototypeOf(base)));

"constructor"
1
"getViewByName"
2
"addView"
3
"renameView"
4
"deleteView"
5
"getColumns"
6
"listColumns"
7
"getShownColumns"
8
"getColumnByName"
9
"getColumnsByType"
10
"getViewRows"
11
"getRowById"
12
"deleteRowById"
13
"deleteRowsByIds"
14
"addRow"
15
"modifyRows"
16
"modifyRow"
17
"getRows"
18
"getRow"
19
"getGroupedRows"
20
"appendRow"
21
"updateRow"
22
"deleteRow"
23
"batchDeleteRows"
24
"filter"
25
"addLink"
26
"removeLink"
27
"updateLinks"
28
"getColumnLinkId"
29
"getLinkedRecords"
30
"query"

Hi @sirajgb,

Sorry about that, the intro of the developer documentation about JavaScript says:

Features that are only available in one context are clearly marked on the respective pages.

But it seems that some of the functions miss this clarification… Here is the list of these functions present in the documentation but not accessible from SeaTables’s script editor:

  • columns: insertColumn, renameColumn, resizeColumn, freezeColumn, moveColumn, modifyColumnType, addColumnOptions, addColumnCascadeSettings, deleteColumn
  • rows: listRows, insertRow, batchAppendRows, batchUpdateRows
  • links: updateLink, batchUpdateLinks
  • other: getMetadata

For now, I can see only two options: adding individual row using base.appendRow in a loop (may consume a lot of API calls) or convert your script to a Python script. If you need help, I think that if you give to any AI-agent your current JS code and both links of the developer documentation — https://developer.seatable.com/python/ and of the source code — https://github.com/seatable/seatable-api-python , you may obtain something effective (don’t forget to backup your data and test the new script before using it on your production data!).

Bests,
Benjamin