Skip to content

Common Functions

Common functions let you set up a shared library of VBScript functions. You can call them from any transform or task that supports VBScript, such as the Map, Filter or Aggregate transforms.

Setup > common Functions

Common functions can:

  • Hold common logic for use throughout an integration or across several integrations.
  • Keep complex functions in one place, where they are easy to edit.
  • Be used in areas that only support in-line VBScript, such as the File Name field on a File IO controller.

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. Are called in the same way as any other Sub or Function.

The example function below shows the parts of a common function.

The New Function dialog with its parts called out. A custom VBScript function is shown whole: the callouts mark the signature line, the body, the End Function line, the Parameter box beneath the editor that supplies a test argument, and the TEST button, whose result appears in the Return Value panel on the right

Test Button

Press Test to run the function.

IMan checks the syntax and, if it is valid, runs the function.

Each parameter in the function signature has its own text field. IMan passes the values you enter in these fields to the function when it runs.

The function uses the values from the parameters, and IMan shows the result on the right-hand side.

IMan raises an error if the function uses a contextual function such as GetValue, Sum or Minimum. These functions need a transaction context to run.