Skip to content

Retrieving User Properties

Description

This operation allows retrieving user properties from the BackendlessUser object stored locally in the client application.

Method

var user = new Backendless.User();
var phoneNumberValue = user[ "YourProperty" ];

Return Value

An object containing properties and corresponding values.

{  
  "propName1" : value,  
  "propName2": value,   
}

Example

The example below logs in as "alice@yourmail.com" and retrieves the phoneNumber user property.

Backendless.UserService.login( "alice@yourmail.com", "wonderland" )
   .then( function( loggedInUser ) {
      console.log( "User has been logged in: " + loggedInUser.email );

     var phoneNumber = loggedInUser[ "phoneNumber" ];
     console.log( "User phone number: + phoneNumber );
   });