You’ll often get to the Function editor from a specific Workflow step (such as Filter, Transform or Validate). While building out the Function, you might decide that the operation (or part of it) would be useful in other steps or even other Workflows. To do that, you have to make it re-usable first.

Turn on Drag select (or Ctrl+click), highlight all of the required Function components (ensure this returns to a single value to be a valid Function) and click Make re-useable. Give your Function a name, description and other details then Apply to create a custom Function.

Using variables

Variables are useful to simplify complex Functions and make them easier to read. Once defined, variables appear as columns in the Preview grid allowing you to see the input, variable value and result in the same row.

For example, you have multiple steps that Trim, Replace and Concatenate an input value. Instead of linking this to the rest of the Function, you can click the final step and Make variable. This will let you give a descriptive name that can then be used elsewhere in the Function. Variables are especially useful when using the input multiple times in a Function.

Testing your Function with Parameters

To test that a Function works in different scenarios, you can specify test data for it by clicking Parameters while in edit mode.

A Parameter can be a column of values from an existing Dataset/View, or you can define your own comma-separated list of test values. The values you enter will be treated as alphanumeric unless a datatype is specified:

  • Numeric value - prefix with {n}, e.g.: {n}1234
  • Boolean value - prefix with {b}, e.g.: {b}true
  • Date value - prefix with {d}, e.g.: {d}1990-01-01 or {d:yyyy-MM-dd}1990-02-03
  • Use double quotes ” ” if a test value contains a comma, e.g.: AB-123,{n}23.53,"Test, value"

Each Parameter will appear as a column in the Preview grid, making it easy to check whether the Function is returning the expected result.