Hi Everyone
Hope you are doing well. Righ now im building an end user app to get a data when a user fill an input. Right now Im facing the issue that my app doesnt obtain the value when I fill the input. Here is my code from app.js:
document.onreadystatechange = function () {
if (document.readyState === 'interactive') renderApp();
async function renderApp() {
try {
window.client = await app.initialized();
client.events.on('app.activated', onAppActivate);
} catch (err) {
handleErr(err);
}
}
};
$(document).ready( function() {
app.initialized()
.then(function(_client) {
console.log("Primea funciona app inicializada");
var client = _client;
client.events.on('app.activated',
function() {
client.request.invoke("serverMethod", {}).then(function(data) {
console.log(data.body);
console.log(data);
objToken = JSON.parse(data.response);
console.log(objToken.access_token, "TOKEN");
});
});
});
});
async function onAppActivate() {
try {
let { portal } = await client.data.get('portal');
let textElement = document.getElementById('apptext');
textElement.innerHTML = `Portal name: ${portal.name}`;
console.log("TEST APP ACTIVADA");
} catch (err) {
handleErr(err);
}
}
function handleErr(err) {
console.error(`Error occured. Details:`, err);
}
$(document).ready ( function() {
app.initialized().then(function(client) {
window.client = client;
client.events.on("customFieldChanged", eventCallBack);
});
});
var eventCallBack = function (event) {
var customField = event.data;
var test = customField.hola;
console.log(test);
}
Here is the capture of my input fields:
![image|690x330](upload://nyIX1pORoa0JRopNEvy0NsWsIsZ.png)
Thank you for your help