Custom Widget Parameters

Custom Widget Parameters

Parameters allow you to send a list of keys and values to your custom widget.

One use of these parameters is to change the way your code behaves. You can have two widgets pointing to the same link, but exhibiting different behaviors.

Each parameter may have a unique key and a value. The key will be used in your code to retrieve the parameter's value.

You can specify up to 20 parameters.


Usage in code

Before reading this section, you should read the Custom Widget tutorial in order to understand how the code works.

In your code, the parameters will be received in the onStart function, like so:

window.TagoIO.onStart((widget) => {
  const display = widget.display;

  const parameters = display.parameters;

  const parameter1 = parameters[0];
  const parameter2 = parameters[1];
});

    • Related Articles

    • Custom Widget

      Custom widgets allow developers to incorporate powerful content in their own widget for their dashboards. Creating your own The sky's the limit when using this widget. You can build your widget using Angular, React, Vue.js, or even plain old ...
    • Configuration Parameters for Devices

      Configuration Parameters are key-value pairs that enable you to customize the behavior of your Devices in different scenarios. For example, you can use them to specify how to decode data or send downlink messages, filter your devices on Widgets, or ...
    • Heat Map Widget

      With the Heat Map widget, you can build a colorful layer with bubbles representing the intensity of the variables on top of your image. The higher the value of the variable, the more red the bubble will be, and you can also add a heat scale to this ...
    • Card Widget

      Use Card to display the last value of a variable, its unit, and a mini-chart. Card accepts links so that when users click on it, it may redirect them to another website, dashboard, or tab.  This widget also accepts features like metadata, that can be ...
    • Keypad Widget

      Keypad allows the user to submit a pin code along with an optional action string. This widget is ideal to represent an alarm or to request a PIN code to unlock a resource. Creating your own To add it to your dashboard, choose the Keypad widget from ...