Enable Custom Java Script for Actions

Users working with analyses and dashboards can add action links that invoke custom JavaScript accessible through a web server. To enable this feature, administrators specify the URL of the web server in System Settings and register the web server as a safe domain.

  1. Develop your scripts in JavaScript, store them in a web server, and make a note of the URL pointing to the JavaScript (*.JS) file containing the custom scripts.
    For example, you might develop a currency conversion script named mycurrencyconversion that you store in myscripts.js, and the URL might be:http://example.com:8080/mycustomscripts/myscripts.js.
  2. Specify the URL of your web server in System Settings:
    1. Click Console, then click System Settings.
    2. In URL for Browser Script Actions, enter the URL that you noted in Step 1.
    3. If prompted to, click Apply.
  3. Register the web server as a safe domain:
    1. Click Console, then click Safe Domains.
    2. Add an entry for the domain in the URL you specified in Step 2.
      For example, you might add: example.com:8080.
    3. For options, select Script and Connect.
  4. Test your configuration:
    1. In Classic Home, open or create an analysis.
    2. Display the Column Properties for a column, click Interaction, then Add Action Link.
    3. Click Create New Action, then Invoke a Browser Script.
    4. Under Function Name enter the name of a script in your JavaScript (*.JS) file.
      For example, USERSCRIPT.mycurrencyconversion.
    5. Save the details, and open the analysis.
    6. Click the column to which you added the action, then click the action.