Api response/ user data into a js variable

i am trying to take the logged in user data from backendless database and input the value as a js variable

then with another button (exit of page) take the new value of the variable and update into the data base

Hello @joe_joe

Let me clarify, your question is about:

  1. How to correctly get the logged-in user data in JS?
  2. How to modify a value and then update it in the Backendless table?

So, if I understood your question correctly:

  1. To get the logged-in user data in JS, you can use Backendless.UserService.getCurrentUser(). Documentation: Get Current User
  2. To update the user object in the database, you can use Backendless.UserService.update(user). Documentation: Update User Object

Regards,
Volodymyr

that helps a lot only problem is how to use value from the api response and create a variable with integer

Hi @joe_joe ,

Here’s a simple example of how you can do it:

const response = await someRequest();
const score = parseInt(response.score, 10); // Integer JS variable

Regards,
Sergey