0

Can HTML Zone update user variable

I have an HTML zone that parses data from an online JSON source and then displays information from the parsed data.  I am setting up a fallback offline state that if I get an error back from the JSON call, or the device loses internet connectivity, then it displays the last saved value from the JSON.  

I am using the plugin networkchecker to verify network connectivity and use the online/offline plugin messages.  

What I am confused about is how do I save/update the user variable (set to shared in BA) from the HTML zone?  The HTML is running locally from the device.

Thanks in advance!

Monica

1 comment

  • 0
    Avatar
    Monica Knutson

    Update!

    After poking through the forums, I was able to do this based on this thread that someone asked about Applescript.

    https://support.brightsign.biz/hc/en-us/community/posts/360039906873-Update-user-variable-using-AppleScript-

    $.post('http://localhost:8008/SetValues', BSvars);

    Where BSvars is a JavaScript object consisting of name:value pairs, for example
    var BSvars = { myVariable:"Hello", myOtherVariable:"World"};

    I've tweaked it to go into a function on my HTML page it's just about the same.

    I initially tried looking up doing it through direct UDP commands, but doing the direct variable update using the local web server's function worked flawlessly. 

    Cheers,
    Monica

Please sign in to leave a comment.