get specific data after a POST

Hi, I need help with this.
I have this code:

var valueUsername = $$(“usernameTextBox”).getValue().toString();
var valuePassword = $$(“passwordTextBox”).getValue();
webix.storage.local.put(“state”, $$(“businessComboBox”).getValue());
var state = webix.storage.local.get(“state”);
console.log(valueUsername + " " + valuePassword);
webix.ajax().post("//172.16.1.5:3000/api/login", { usuario: valueUsername, password: valuePassword, codemp: state }).then(function (data) {
//response text
if (data.success == true) {
webix.$$(‘main’).show();
webix.$$(‘toolbar’).show();
$$(“businessComboBox”).refresh();
console.log(state);
} else {
webix.message(“Usuario o contraseña inválidos”);
}
console.log(data.text());
});

What I want is to get a specific data after a POST because i need the value of “success” to know if the data that the user provide is correct let it continue with the web page.

Hey @Hellekin. you can access the specific data with the help of the JSON parser - data.json(), after that you can look through the data presented as a normal JS object and search for the property you need: https://snippet.webix.com/s13uvdv0.

Thanks for your help @Dzmitry