I am working on a project where I am setting properties in JS to store in Backendless User. The problem I am having is that the mapping is not working. For example.
In JS I set the following.
user.numberOfMessagesSent = 3;
user.numberOfMessagesReceived = 4;
At Backendless the numbers are reversed.
numberOfMessagesSent = 4
numberOfMessagesReceived = 3
I’ve deleted the properties at Backendless to see if they would remap but the same problem persisted. Any ideas?
Hello!
This issue looks really weird. Can you provide a small code snippet to reproduce it?
Here is a snippets which works for us:
var user = Backendless.UserService.login( "testUser@foo.bar", "pswrd" );
user.propertyOne = 1;
user.propertyTwo = 2;
Backendless.UserService.update( user );
Try it and tell us if it works for you.
Thanks,
Alex
Here is the code I am using.
From JS
var user = new Backendless.User();
user.numberOfMessagesSent = 3;
user.numberOfMessagesReceived = 4;
var emailSearch = Backendless.Persistence.of(Backendless.User);
var dataQuery = new Backendless.DataQuery();
dataQuery.condition = "email = '" + user.email +"'";
// Create the User Registration Function with a Promise
function signUpNewUser(user)
{
return new Promise(function(resolve, reject)
{
Backendless.UserService.register(user, new Backendless.Async(function(user)
{
resolve({"responseCode" : "The user was successfully created!"});
}, function(error)
{
reject(error);
}));
});
}
The signUpNewUser method is called later in a promise. The result in Backendless shows that numberOMessagesReceived is correct but numberOfMessagesSent is missing. The 3 shows up in a completely different field.
http://support.backendless.com/public/attachments/15a857948a75bb477d2d027047fd2e46.png</img>
Here is where the 3 shows up.
http://support.backendless.com/public/attachments/a473f4635db3081d965a147c4850a871.png</img>
I’ve experimented with deleting the properties and reading them, adding new properties and the results vary each time. Ultimately, it seems like the mapping for all of the properties the project are off.

Try to do the following: after user creation navigate to REST console, choose table Users and execute GET. After that find the created user by objectId and check if it has correct properties.
Also try to refresh console page.
I did as you suggested and have found the following.
-
The refresh did nothing to help.
-
The REST GET shows all of the values are correct.
Is there a way to correct the console so that is shows the proper values?
Hi Jon,
Let me clarify the issue a bit.
Using SDK (REST or JS) you get the proper results, right? I mean, the fields values are the same as you had set.
But on Backendless Data Console tab you see them mixed up. Is it correct?
If yes, please provide your application ID so that we can investigate it with your app, since we don’t observer such behaviour on our test ones.
Yes, you are correct. If I pull values from REST or JS they are accurate. Many of the values I am looking at in the console are incorrect. Here is my Application ID: 11E0B2F6-2EB1-10DC-FF02-8E776E070200
Has someone had a chance to look into this issue? I still see that the mapping in my console is off.
I can’t reproduce your issue
I have saved next user:
{
"lastName": "last name test",
"largestTipReceived": 1,
"numberOfTipsSent": 2,
"totalTipValueReceivedHistory": 3,
"largestTipSent": 4,
"numberOfTipsReceived": 5,
"accountClaimed": true,
"totalTipValueSentHistory": 6,
"scanCode": "",
"firstName": "first name test",
"userImage": "https://api.backendless.com/11e0b2f6-2eb1-10dc-ff02-8e776e070200/v1/files/images/default.png",
"name": null,
"accountBalance": 7,
"email": "test_email@gmail.com",
"username": "test$gmail",
"password": "test"
}
and everything fine, check screanshot please
http://take.ms/xzM8L
If you use a REST GET like shown in the image there is not issue. The problem is in the console view. The values are out of place. Are you able to see the table views in the console.
I check the console and see that everything is ok, also check the screanshot and you will see that every thing is on right place.
I see something very different. Starting with largestTipReceived things are out of place. I am using Safari. Does the browser matter?
http://support.backendless.com/public/attachments/394e708ca30167943cfca80204ceb87c.png</img>
If I log in with Chrome the everything is in the correct place. It looks like there is an issue with Safari 9.1.2.
Hi Jon
Could you please clean the localStorage in Safari and try again ?
Safari -> Preferences -> Privacy -> Cookies and Website Data -> Details… -> backendless.com -> Remove
That fixed it. Thanks for the help. You guys are awesome.