Add a script to a widget

You can add JavaScript to a widget to customize it for your agency or department. This script is then run each time someone accesses the widget.

Note:

  • While the ESO Insights module supports adding JavaScript to a widget, this is an advanced feature that requires experience with using JavaScript. For best results, contact your ESO representative and ask for assistance.

  • You must have a designer role assigned to you in the ESO Insights module to add JavaScript to a widget.

    Information on role assignments is available in Assign user roles in the ESO Insights module.

  1. Click the name of the dashboard you want to work with.

    Tip: If the list of dashboards is long, you locate the dashboard you want more easily, as described in Find and open an existing dashboard or report.

    The dashboard opens and displays any widgets it contains, and the data those widgets link to.

    Click graphics
    to open them.
  2. (If opening an existing dashboard) In the upper right corner of the widget you want to work with, click the edit () icon.

    The widget opens for configuring.

  3. Click the three-dot menu icon, then choose Edit Script from the menu that appears.

    A new browser window opens, displaying a script editor.

  4. In the script editor, add the JavaScript code you want to run every time the dashboard opens.

    Example:
    // Widget script that prints the widget title to the console
    console.log(widget.title);

  5. Click Save.

    A confirmation message appears, then closes automatically.