Skip to content

Retrieve User Schema

An application can get a list of the properties associated with the user schema by using the following API:

Non-Blocking API

The method call does not block - it returns immediately . The callback argument receives either the response or the fault returned by the Backendless servers.

public void Backendless.UserService.describeUserClass( AsyncCallback<List<UserProperty>> callback );

where:

Argument                Description
callback an object which receives either a return value or an error from the server. The return value from the server is a collection of the UserProperty objects. The class of the callback object must implement the AsyncCallback<List<UserProperty>> interface.

The UserProperty class is defined as:

public class UserProperty
{
  // The method returns true if the property is marked as 'identity'
  public boolean isIdentity();

  // Returns the name of the property
  public String getName();

  // Returns true if the property is required during user registration
  public boolean isRequired();

  // Returns the data type of the property
  public DateTypeEnum getType();
}

Blocking API

public List<UserProperty> Backendless.UserService.describeUserClass();

Non-Blocking API Example

// do not forget to call Backendless.initApp when your app initializes
Backendless.UserService.describeUserClass( new AsyncCallback<List<UserProperty>>()
{
 public void handleResponse( List<UserProperty> properties )
  {
    for( UserProperty userProp : properties )
    {
      Log.i( "MYAPP", "Property name - " + userProp.getName();
      Log.i( "MYAPP", "\trequired - " + userProp.isRequired();
      Log.i( "MYAPP", "\tidentity - " + userProp.isIdentity();
      Log.i( "MYAPP", "\tdata type - " + userProp.getType();
    }
  }

  public void handleFault( BackendlessFault fault )
  {
  }
});

Blocking API Example

// do not forget to call Backendless.initApp when your app initializes
List<UserProperty> properties = Backendless.UserService.describeUserClass();

for( UserProperty userProp : properties )
{
  Log.i( "MYAPP", "Property name - " + userProp.getName();
  Log.i( "MYAPP", "\trequired - " + userProp.isRequired();
  Log.i( "MYAPP", "\tidentity - " + userProp.isIdentity();
  Log.i( "MYAPP", "\tdata type - " + userProp.getType();
}