Skip to main content

User Defined Functions Page

In the User Defined Functions page, you can upload programmatic functions that you have created to extend the transformation capabilities of Dataprep by Trifacta.

Note

This feature may not be available in all product editions. For more information on available features, see Compare Editions.

A user-defined function (UDF) is an externally created function that can be imported into the product for use in your recipe steps.

Tip

UDFs can be created in JavaScript.

Tip

By default, UDFs are shared with all users in the project. Users that do not have access privileges on UDFs can still use the functions inWrangle.

For more information on the requirements for structuring your user-defined functions, seeJavaScript UDFs.

UserDefinedFunctionsPage.png

Figure: User Defined Functions Page

To review specifics about the UDF, click its name. See User Defined Function Details Page.

Columns:

  • Name: Name of the UDF.

  • Owner: The user who created the UDF.

  • Last Updated: Timestamp for when the UDF was last modified.

Actions:

  • Create UDF: Click this button to create a user-defined function.

    Note

    You must have Author-level access to user defined functions to create new UDFs.

    See "Create UDF" below.

  • Search:Enter a string in the search box. The list of UDFs is updated in real-time.

  • Sort: Click the caret next to any column head to sort the list based on the column.

  • Context Menu: See below.

Context menu options:

  • Edit: Modify the name and description for the UDF.

  • Rename: Rename your user-defined function.

    Note

    UDF names must be unique within the project or workspace. Name changes are propagated to the recipe steps where they are referenced.

  • Duplicate: Create a copy of the user-defined function.

  • Transfer ownership: (Available to owner or admin only) Transfer ownership of this asset to another user. See Transfer Asset Ownership.

  • Delete:Delete the UDF.

    Note

    Before deleting, you should review the Used In tab to remove references to the UDF. When a UDF is deleted, any recipe steps that use it are broken.

    Warning

    Deleting a UDF cannot be undone.

Create UDF

Steps:

  1. In the User Defined Functions page, click Create UDF.

  2. Name: The name of your function must be unique within the workspace. Avoid using names that correspond to keywords in Wrangle.

  3. Description: Enter a text description for your function.

  4. In the Create UDF window:

    1. Paste in the script for your user-defined function.

      Tip

      Elements of your syntax are automatically validated for you. You must fix these errors before saving.

    2. Click Validate. Fix any errors.

  5. To create the UDF, click Create.

The UDF is now available for use by all users of the workspace. For more information, see JavaScript UDFs.