Global Functions

The Global Function feature lets you create a customized, self-made advanced command that contains a set of advanced commands of your choice. Once you create a Global Function, you can apply it to any Wizard in the Company.

Usage

Imagine that there is a repetitive, fixed set of actions (a set of advanced commands) that need to occur more than once across a wizard, or across several wizards. Instead of re-creating and re-configuring the same set of advanced commands repeatedly in the relevant wizard(s), you can create them ONCE as a Global Function, and apply the Global Function in different wizard(s).

Known limitation

Since the Global Function is created by compiling a set of advanced commands, and NOT a recorded session, you cannot insert into it advanced commands that require only recorded steps.

  • Workaround: Advanced commands that require recorded steps (e.g. mouse click) should be inserted into a Global Group.

An overview of how it works:

  1. Creating a Global Function

  2. Adding the global function to the relevant wizard(s)

  • Note: A Global Function is applicable across the wizards in the same Company only; a Global Function created under CompanyA cannot be applied in CompanyB.

Creating Global Function

To create a Global Function:

  1. Create a new Global Function

    Option 1: Right-click a category > New Global Function

    Option 2:  Click a category > Select New Global Function at the bottom action pane

  2. Configure and Save the Global Function

    General Set the name of the Global Function.

    Function usage: A view of published wizards that use this global function (this view is populated once the global function is applied in a wizard)

    Save your changes

  3. Get Started with the Global Function Editor.

Global Function Components

Creating the parameters necessary for the Global Function to work is simple, but steps need to be followed so that it is done correctly. The Global Function works as a mini wizard, within the larger wizard that it is placed, and it is comprised of 3 parts.

  1. Step 1: Function Start

    This is where you will set up all of your defaults and parameters to prepare for the action

  2. Run-time Adjustment Zone

    This is where you will insert the run-time adjustments/commands

  3. Step 2: Function End

    This is where the main action happens to create the output that you wish to occur

You do not want to put all of your code in the first part, as it will not function as it should. Separate the beginning parameters into Step 1 and the main action into Step 2, these will remain as the default with predefined values. There is, however, the possibility for users to insert adjustments for a function on a single run, which in turn influences the final output.

Global Function Components Explained

The Global Function mini wizard that you drag and drop into the steps editor of the Nintex Wizard Editor, is a mirror image to the Edit Global Function. In both, you can see three sections: Step 1, Run-time Adjustment Zone, and Step 2.

In the Global Function mini wizard, within the steps editor, you will see the default Global Function with only the ability to edit or add a run-time adjustment. In that area, the Run-time Adjustment Zone, you have the ability to create an adjustment, such as changing increments of a predefined value to 2, 4, 6. Such an adjustment will only be implemented on that specific run. This will make the wizard perform Step 1, and then it will take the added adjustment command which will influence the main action that will be performed in Step 2.

To edit the default Global Function's Step 1 and Step 2, you will need to make the changes through the Global Function Editor.

Global Function Editor

In the Global Function Editor, you have the ability to set up all of the default parameters necessary to create the output that you need for your Global Function wizard. You can set up the commands in:

  • Step 1: Function Start

  • Step 2: Function End

To Edit the Global Function:

  1. Click GET STARTED to open the Global Function Editor.

  2. Build the set of advanced commands that make the global function

    Note: The Global Function editor is significantly simpler than the regular Wizard editor. It doesn't contain the regular wizard editor features, such as Bubbles or Core actions. It contains only two steps - a starting and an ending one - and a list of Advanced Commands that you can use.

  3. Save

  4. Publish the Global Function by changing its status to Published.

    Note: For the Global Function to be applicable and used in wizards, its status must be Published.

Adding the Global Function to Wizards

  1. Open/Edit your wizard in the Advanced Command view.

  2. Drag the Global Function advanced command into the steps editor:

  3. Select the relevant Global Function (you can also search for it):

    Note:  The catalog presents only published global functions.

  4. Once you select a global function, its variables are presented for your reference.

    Example:

    Tip: You can highlight and copy the variables to your clipboard to use later in the wizard.

  5. Instruct the wizard how to handle any errors encountered - if relevant (you can also leave it as is).

    Read more about Error Handling.

  6. Optional: You can further customize the selected global function by adding to it more advanced commands. Any commands you drag into a global function in a wizard will be applicable only to this specific wizard.

    Added commands will appear in the white Run-time Adjustment Zone (between Function start and Function end).

Example of a global function that is customized in a wizard:

Lets take a look at the following Global Function. Its purpose is to make sure that the first letter in the first and last name is capitalized.

Now lets open the wizard where this global function is applied in. As you can see, there is an additional advanced command to backup the old full name in this specific wizard.

If you click Do it, the process will run. When it is done, you'll see the process Variable list (as set in the original Global Function) and the additional customized Set value command (that is added to this specific wizard):

So what happened here? An example of a possible scenario:

Making sure the first letter of the first and last name is capitalized is a task we want to have applied across different wizards / multiple times, for every excel file that contains full names. Therefore, we've created the whole repetitive process one time, as a global function. We started applying this global function in different wizards - whenever and wherever it is relevant. In one of the wizards, we decided that there is a need to backup the original names as well, as they were originally typed. Therefore, we added an additional relevant advanced command/adjustment into the Run-time Adjusment Zone of the Global Function