I’m looking for a way to be able to change various elements of a Widget, such as Topic, Variable Alias and others, from any changes to a variable in a Bucket from data received from a Device. This would be used to dynamically customize the Dashboard Widgets display based on configuration data received from a Device.
That’s not very practical, as I would have to re-invent each of the Widgets I’m using to add the desired capability!
As a matter-of-fact, I tried to duplicate the Custom Widget tutorial (custom-widget-iframe/279), but could not get it to work.
I am currently exploring the use of the JS SDK API in Analysis scripts to do what I want with some success so far.
In this case, you can use the API to edit the widget properties:
Node.js | Account | Widgets | .edit
You can do it using an Analysis based on the data that you got.
By the way, could you inform us which part of the Custom Widget Overview tutorial you got lost?
However, no error occurs when sending the data from the custom widget and the Dynamic Table does not get the sent data. Also, in looking at the Device Bucket’s variable tab, I do not see the variable “my_variable2” there after sending from the custom widget. I did confirm the sendData() function was being called with a “console.log()” statement in the function with the Web Console in my Firefox browser.
I also confirmed that the Dynamic Table does show the “my_variable2” variable data by using the device Emulator to send test data to “my_variable2” and that works as expected, and after such, the variable “my_variable2” was now shown in the Bucket.
I don’t know how to actually confirm the sendData() function was actually sending the data or not. I tried to use Live Inspector and it did not show any data being received from the custom widget, but I did see the test data sent by the Emulator.
So, in summary, the tutorial’s custom widget would not send data to show up in the Dynamic Table.
Thanks for your feedback, we will improve the tutorial.