Skip to main content

Reusable Attribute Transforms

When incoming data needs to be transformed via a function not covered in Nexla's pre-built transform functions, users can create a custom reusable attribute transform function using Python, JavaScript, or JSON. Reusable attribute transforms are added to the list of transform functions used to create Nexset Rules in the Nexset Designer.

1. What are Reusable Attribute Transforms?

Reusable attribute transforms consist of custom transform code that provide reusable transform functions for individual attributes in a Nexset.

Reusable Attribute Transforms vs. Reusable Record Transforms

Reusable attribute transforms are applied to individual Nexset attributes.

To learn how to create custom reusable transforms that define the entire output Nexset, see Reusable Record Transforms.

Once created, reusable attribute transforms can be accessed within the pulldown Function menu in Transform Builder mode in the Nexset Designer and can be used in any data flow, avoiding the need to recreate custom attribute transforms each time they are applied.

Reusable attribute transforms can also be shared with others in a user's organization.

2. Create a Reusable Attribute Transform

This section provides instructions for creating a new reusable attribute transform in Nexla.

2.1 Create a New Reusable Attribute Transform

  1. Navigate to the ReusableTransforms.png screen in the Integrate.png section.

      ReusableTransforms2.png

  2. Ensure that the AttrTransform.png tab is selected.

      AttrTransform2.png

  3. Click NewAttrTransform.png to open the Create Attribute Transform screen.

      CreateAttributeTransform.png

2.2 Attribute Transform Name & Documentation

  1. In the Create Attribute Transform screen, enter a name for the custom attribute transform in the text field at the top of the center panel.

      AttrTxName.png

  2. Enter a brief description of the custom attribute transform in the Description text field below the transform name.

    Text entered in this field will appear as the transform function summary in the Function pulldown menu in the Nexset Designer.

      AttrTxDesc.png

  3. Optional: Click Documentation.png in the top right corner of the center panel to open the Documentation drawer, and enter an expanded description and/or additional information about the transform in the text field.

    Documentation helps users understand what a custom attribute transform does, its intented purpose, etc. This is particularly useful when an organization includes many resources and many users, as well as when triaging data flows.

      Documentation2.png

    • Click SaveDocumentation.png to save the entered information and close the Documentation drawer.

2.3 Define the Transform Function

  1. Select the language that will be used for the attribute transform by clicking the Python or JavaScript button at the top of the Function Code box.

      SelectLanguage.png

  2. In the Function Arguments box, enter a name and description for the function argument(s).

    info

    Function arguments are selectable variables that will be surfaced to users of the transform.

    • To include additional arguments, click AddArgument.png at the bottom of the arguments list.

    • To Delete an argument from the Function Arguments list, click the DeleteIcon.png icon to the right of the argument.

      FunctionArgs.png

  3. Enter the attribute transform code in the Function Code text box using the language format selected in Step 1.

      FunctionCode.png

    Attribute Transform Formatting & Preview

    Transform Code Format:
    The attribute transform function signature follows the format of transformAttribute (input, metadata, args). Attribute transform functions receive an entire record as input.

    Typically, at least one argument that contains the name of the input attribute value to be transformed should be defined.


    Transform Builder Preview:

    The Transform Builder Preview box at the top of the right-side panel shows a preview of the pulldown menus and/or text fields that will be shown to users who apply this transform using Transform Builder mode in the Nexset Designer.

    The associated pulldown menus and/or text fields that will be shown to users of the transform are listed under each function argument.

    TxBuildPreview.png
    Reference Existing Transforms

    When creating a custom attribute transform, any existing custom attribute transform accessible to the account can be referenced using the Attribute Transforms panel on the left side of the screen.

      ReferenceTx1.png

    Click on a transform listed in this panel to open the transform information drawer. This drawer displays information about the transform in addition to the transform code. Any portion of the code can be copied for use in the new attribute transform.

      ReferenceTx2.png

2.4 Test the Attribute Transform Function

Once the custom attribute transform code has been entered, the function can be tested using sample data. This sample data can be entered manually or pulled from an existing Nexset.

  1. Enter or select sample data with which the custom attribute transform will be tested. The steps below provide instructions for loading sample data from an existing Nexset or entering the sample data manually.

    • Load Sample Data from a Nexset:
    1. In the Test Sample Input box at the bottom of the center panel, click the LoadSample.png button.

        LoadSample2.png

    2. Use the Load Sample Data from a Nexset window to select a Nexset from the list. A sample record will be loaded from the selected Nexset to test the custom transform function.

        LoadSample2.png

      • To filter listed Nexsets by name, enter the full or partial Nexset name in the text field at the top of the window.

          LoadDataWindow2.png

      • Select a Nexset by clicking the option button to the left of it.

          LoadDataWindow3.png

    3. Click the LoadSamplesButton.png button in the bottom right corner of the window to load a sample record from the selected Nexset into the Test Sample Input box.

        TestSampleInput.png


    • Enter Sample Data Manually:
    1. To enter sample data manually, type the sample data into the Test Sample Input text field at the bottom of the center panel.

      Sample data must be entered in JSON format.

        ManualSamples.png


  2. In the Function Argument Values box, select the input type to which each argument should be applied, and enter or select the corresponding value(s).

Select Argument Value Type
FxArgValueType.png

Select Argument Value
FxArgValue.png

  1. Click the TestTransform.png button at the top of the Function Code boxwhere the custom transform code was entered in Section 2.3 to apply the transform to the sample data.

      TestTransform2.png

  2. The output data resulting from applying the custom transform to the sample data will be shown in the Generated Output box on the bottom-right of the screen.

      GenOutput.png

2.5 Save the Reusable Attribute Transform

  1. Once the custom attribute transform has been entered and tested to confirm that it produces the expected output, click Create.png in the top right corner of the screen to save and create the transform.

    info

    The reusable attribute transform will now be accessible to the owner from the Function menu in the Nexset Designer. To learn how to share reusable attribute transforms with other users, see Section 4.

3. Use a Reusable Attribute Transform

    • To apply a reusable attribute transform in a new rule group:
      In the Nexset Designer, click Add_Rule_Group.png in the Nexset Rules panel, and select Transform.png from the dropdown menu.

    Rule_Group_Menu.png

    • To add a reusable transform to an existing Transform rule group:
      Click Add_New_Transform.png at the bottom of the rule group.
  1. Enter a name for the output attribute in the Output Attribute field.

      Output_Attribute.png

  2. Use the Function pulldown menu to select the desired reusable transform.

    info

    Available reusable transforms are listed under the "Reusable Attribute Transform Code" category located at the bottom of the Function list.

      Function_Menu.png

  3. Populate the required fields, and click Run_Nexset_Rules.png to generate output samples in the Nexset Output panel.

  4. Click Save2.png in the top right corner of the screen at any point to save the current transform progress. Once the transform is complete, click Save_Close.png to save the transform and close the Nexset Designer.

4. Share a Reusable Attribute Transform

  1. To share a reusable attribute transform, navigate to the ReusableTransforms.png screen in the Integrate.png section, and select the AttrTransform.png tab.

      AttrTransform3.png

    Attribute Transforms Tab

    In the Attribute Transforms tab, all reusable attribute transforms accessible to the user can be viewed.
    By default, custom attribute transforms owned by the user are shown. To view shared transforms, change the value of the access keyword to collaborator in the search bar at the top of the screen.
     ViewShared.png

  2. Click on the transform to be shared to open its information drawer, and select the Access tab.

      AccessTab.png

  3. Use the pulldown menu on the left to select the user, group, or email address with whom the transform will be shared.

      SelectUser.png

  4. Choose the level of access that will be granted to the selected user(s) from the pulldown menu on the right.

      AccessLevel.png

  5. Click the GrantAccess.png button to share the reusable attribute transform with the user(s) at the selected access level.

    • The shared reusable attribute transform will now be accessible to the selected user(s) from the Function menu in the Nexset Designer.

5. Edit a Reusable Attribute Transform

Updating Attribute Transforms

When a reusable attribute transform is applied to a Nexset, that Nexset references the applied transform resource. Because the Nexset references the attribute transform resource, any changes to a reusable attribute transform are automatically applied to any Nexsets currently referring to that transform.

Therefore, use caution when editing a custom reusable attribute transform, as edits will affect existing Nexsets/data flows using the transform.

  1. To edit a reusable attribute transform, navigate to the ReusableTransforms.png screen in the Integrate.png section, and select the AttrTransform.png tab.

      AttrTransform3.png

    Access Levels

    Users can only edit owned reusable attribute transforms and those to which they have been granted Administrator access.

  2. Click Edit.png on the transform to be edited, and select Edit_Menu.png from the dropdown menu.

      EditTx.png

  3. In the Edit Attribute Transform screen, users can make any necessary edits to the transform code, name, and description.

      EditAttrTx.png

    Testing Edited Transforms

    When editing the code of a custom reusable attribute transform, before saving the edits, follow the instructions in Section 2.4 to test the edited transform code and ensure that the expected output data is generated.

  4. Once all edits are complete, click Save.png in the top right corner of the screen to save the changes to the reusable attribute transform.