Lifecycle Methods

The HTML SDK provides five lifecycle methods that can be used in a variety of patterns to create tools.

Lifecycle methods

The lifecycle methods load in the following order:

  1. SetConfiguration: Executed when the tool is clicked on. Used to obtain the tool's configuration as soon as the tool finishes loading the HTML.
  2. SetConfiguration: function (currentToolConfiguration){...}
  3. BeforeLoad: Executed before the data stores are loaded. Used to manually configure data stores.
  4. window.Alteryx.Gui.BeforeLoad = function (manager, AlteryxDataItems, json) {...}
  5. AfterLoad: Executed after the data stores have been loaded. Used to trigger application logic. Retrieves values from data items after the manager has loaded values from the incoming XML configuration.
  6. window.Alteryx.Gui.AfterLoad = function (manager, AlteryxDataItems) {...}
  7. BeforeGetConfiguration: Executed before the GetConfiguration event is fired. Allows for current configuration data to be changed before obtaining the tool configuration on deselection. Used to change the values or the structure of the persisted data.
  8. window.Alteryx.Gui.BeforeGetConfiguration = function (json) {...}
  9. GetConfiguration: Executes as the final action before a tool is deselected, obtains the tool configuration from the GUI.
  10. GetConfiguration: function () {...}

UI creation patterns

There are several methods available to creating a tool. Evaluate what your users require of your tool before determining what method of creation you want to use.

If the tool is filling in an existing UI, it does not need to persist configuration between uses. If the tool has configuration settings that persist, but are not displayed to a user, the tool does not need to synchronize data between UI controls and the configuration persistence.


UI creation pattern Tool automatically loads and persists your configuration Tool automatically synchronizes data between UI controls and configuration persistence
Use only SetConfiguration and GetConfiguration No No
Use BeforeLoad and AfterLoad with Data Items Yes No
Using data items with widgets Yes Yes