Common Functions

Common functions allow you to setup a shared library of VBScript functions which can be called from any VBScript enabled transform/task, such as the Map, Filter or Aggregate transforms.

This is an incredibly useful resource.

Setup > common Functions

Common functions can:

  • Embed common logic which can be used throughout an integration or across multiple integrations.
  • Handle particularly complex functions, so they can be easily edited.
  • Use these functions in areas that only support in-line VBScript, such as the File Name field on a File IO Contoller.

Common Functions have many properties

  1. Can be either a Sub or a Function.
  2. Must have a method header and footer.
  3. Can have arguments.
  4. The calling convention for a ‘Common Function’ is exactly as any other Sub or Function.

An example function (below) illustrates the different parts of a common function.

Test Button

When pressed the function will be invoked.

The test function checks syntax, and execute the function assuming the syntax is valid.

The parameters from the function signature will each have their own text field. The values entered into these text fields will be supplied as the values to the function when executed.

The Function will use the values from the Parameters and the results from the query showed on the right hand side.

An error will occur if the function uses a contextual function such as GetValue, Sum, Minimum, since these functions require a transaction context to execute.