Skip to content

Deleting Single Object


Future<int>"TABLE-NAME").remove({Map entity, String whereClause});
Future<int><E>().remove({E entity, String whereClause});


Argument                Description
TABLE-NAME Name of the table where the object represented by Map will be deleted from. There must be objectId property in the map. The value of the property identifies the object which will be deleted.
E Data class of the data object to delete.
entity Data object to delete. Must contain the objectId property which identifies the object in the database.

Return Value

The timestamp when the server-side removed the object from the data store.


void deleteContact() {
  Map contact = {
    "name": "Jack Daniels",
    "age": 147,
    "phone": "777-777-777",
    "title": "Favorites",
  };"Contact").save(contact).then((savedContact) {
    // now delete the saved object"Contact").remove(entity: savedContact);

Consider the following class:

import 'package:backendless_sdk/backendless_sdk.dart';

class Contact {
  String objectId;
  String name;
  int age;
  String phone;
  String title;
The following code saves a new instance of the Contact class and subsequently updates it:
void deleteContact() {
  Contact contact = Contact() = "Jack Daniels"
    ..age = 147 = "777-777-777"
    ..title = "Favorites";<Contact>().save(contact).then((savedContact) {
    // now delete the saved object<Contact>().remove(entity: savedContact);

Codeless Reference



Argument                Description
table name Name of the data table where an object will be deleted from.
object or objectId This parameter expects either a unique identifier(objectId) of the record that must be deleted in the data table, or a data object which must contain the objectId property which identifies the object in the database. String value or number.

This operation does not return a value.

Consider the following records in the employees data table:


The example below deletes the object associated with the objectId: "8948E66F-67DE-441B-A7F8-DAB89965E27C".


The result of this operation will look as shown below after the Codeless logic runs. As you can see, the object with the name "Bob Smith" associated with the objectId: "8948E66F-67DE-441B-A7F8-DAB89965E27C" has been deleted from the data table.


You can also delete a record from the data table by passing an object to the operation. The object must have the objectId property and the unique identifier of the record that must be deleted. The example below deletes a record from the data table using an object that contains the following objectId: "FEA94D74-BEA1-4F28-BDDD-FB22CFEB747E"


The result of this operation is a deleted record from the employees data table: