Lets say this is a Simple Custom HTML screen, I have checked previous threads where on App variable value changes App.onVariableChange, the value gets updated in Custom HTML, now lets assume I have a variable with value 10 and I want to Display it on the Custom HTML COntent , how can this be done.
Previous Thread:
hi @Akshay_B
To display your app variable (e.g., value 10) in Custom HTML:
HTML:
xml
<div id="variableDisplay">Loading...</div>
JavaScript (paste in Custom HTML JS editor):
javascript
async function updateDisplay() {
const value = await App.getVariable('yourVariableName');
document.getElementById('variableDisplay').innerText = value || 'N/A';
}
App.onVariableChange('yourVariableName', (value) => {
document.getElementById('variableDisplay').innerText = value || 'N/A';
});
updateDisplay(); // Initial load
Replace 'yourVariableName' with your actual app variable name. This works for initial display + real-time updates.
Hey , Thank you so much That Worked. Now I can use this with the actual HTML Content. Again Thank you
1 Like
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
