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.
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.
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:
Each Parameter will appear as a column in the Preview grid, making it easy to check whether the Function is returning the expected result.