Components > User-defined functions > Creating expressions with user-defined functions
  

Creating expressions with user-defined functions

You can add a user-defined function to a transformation or field expression.
When you create an expression, valid user-defined functions appear in the expression editor. If you type in an expression manually, precede each user-defined function with :UDF.
The following image shows a user-defined function selected in the expression editor of an Expression transformation:
In this image, "User-defined functions" is selected in the drop-down list on the left. The user-defined function RemoveSpaces is selected in the list on the left and has been added to the expression on the right.
When you select a user-defined function, the expression editor shows the function syntax in the following format:
<function name> (<argument 1> as <data type>, <argument N> as <data type>)
For example:
RemoveSpaces(TextString as string)
When you add the function to the expression, the function includes the prefix :UDF, as shown in the following example:
:UDF.RemoveSpaces(TextString)
After you add the function to the expression, replace the arguments with field names or parameters. For more information about creating expressions, see Tasks.
When you validate the expression, Data Integration does not validate the user-defined function. It only validates the expression.