Skip to content

Remove User

Description

This operation deletes a specific user from the Users data table.

Method

The signature presented below expects the "objectId" to delete a user record from the data table. The "objectId" property is a unique identifier assigned by Backendless to the user account.  You can also pass the BackendlessUser object containing the objectId to delete a record.

Blocking API:

BackendlessUser Backendless.Data.Of<BackendlessUser>().Remove(BackendlessUser user);

Non-blocking API:

Task<BackendlessUser> Backendless.Data.Of<BackendlessUser>().RemoveAsync(BackendlessUser user);

Non-blocking API with Callback:

void Backendless.Data.Of<BackendlessUser>().Remove(BackendlessUser user, AsyncCallback<Int64> callback);

where:

Argument                Description
objectId Unique identifier of a user record that must be deleted from the Users data table. String value or number. Refer to the Data Import topic to learn more about objectId value as the number.
callback A callback object which will receive a callback when the method successfully returns a result or an error. Applies to the non-blocking methods only.

Return Value

The object containing a timestamp when the Backendless server has removed the object from the data store.

Example

The example below deletes the user record associated with the following objectId: "4D584E4D-05A3-4AC4-90C7-B80D1584E7AD".

Blocking API:

BackendlessUser Backendless.UserService.Data.Of<BackendlessUser>().FindById(String objectId);

Non-blocking API:

Task<BackendlessUser> Backendless.UserService.Data.Of<BackendlessUser>().FindByIdAsync(String objectId);

Non-blocking API with Callback:

void Backendless.UserService.Data.Of<BackendlessUser>().FindById(String objectId, AsyncCallback<BackendlessUser> callback);

Codeless Reference

user_service_codeless_remove_user

where:

Argument                Description
objectId Unique identifier of a user record that must be deleted from the Users data table.

Returns the timestamp when the Backendless server has removed the object from the data store.

Consider the following record in the Users data table:
user_service_codeless_example_remove_user_3

The example below removes the user "alice@yourmail.com" associated with the objectId: "4D584E4D-05A3-4AC4-90C7-B80D1584E7AD".

user_service_codeless_example_remove_user

The output will look as shown below after the Codeless logic runs:

user_service_codeless_example_remove_user_2