Bulk Delete Rows
Catalyst enables you to delete records or rows of data in bulk from a specific table in the Data Store. The table is referred by its unique ID or name. You can obtain the table ID from Data Store or from the URL when the table is opened in the console.
The bulk delete operation can delete a maximum of 200 rows in a single operation. You can pass the unique ROWIDs of the rows to be deleted in an array as shown in the sample code below. You must include at least one ROWID, and can include upto 200 ROWIDs, in the code.
The array is assigned to a variable which is passed to the deleteRows() function through deletePromise in the sample code. The table name or table ID must be passed to datastore.tableId().
The datastore reference used below is defined in the component instance page.
copyvar datastore = catalyst.table; //Pass the table ID or table name var table = datastore.tableId('EmpDetails'); //Declare the ROWIDs of the records to be deleted var rowIds =[1028000000171815, 1028000000171810, 1028000000171805, 1028000000171617, 1028000000171098]; //Pass the array of the ROWIDs to the deleteRows() function var deletePromise = table.deleteRows(rowIds); //Returns the promise and prints in the browser console deletePromise .then((response) => { console.log(response.content); }) .catch((err) => { console.log(err); });
Last Updated 2023-11-14 13:20:49 +0530 +0530
Yes
No
Send your feedback to us