Reusable Record Transforms
When the same set of transform funcitons needs to be repeatedly applied to multiple Nexsets and/or data flows, creating a reusable record transform can save time and ensure consistency. Instead of requiring users to set up identical transforms for each Nexset in this scenario, a reusable record transform can be applied to define the entire output Nexset record.
1. What are Reusable Record Transforms?
Reusable record transforms consist of custom code that defines the entire structure of the output record—i.e., the entire output Nexset—and can be created using Python, JavaScript, or JSON code in Nexla. These transforms receive an entire Nexset record as input, along with any metadata information about the Nexset as metadata.
For data flows that require the repeated application of a common set of transformation functions, reusable record transforms can provide significant time-savings. Reusable record transforms can be easily created, applied, edited, and shared with others in the user's organization.
Reusable record transforms define the entire output Nexset record.
To learn how to create custom reusable transforms that are applied to individual attributes and define a single attribute in the output Nexset, see Reusable Attribute Transforms.
Once created, reusable record transforms can be accessed within the the Nexset Designer and can be applied to any Nexset, avoiding the need to apply the same transform functions individually for each data flow.
Reusable record transforms can also be shared with others in a user's organization.
2. Create a Reusable Record Transform
This section provides instructions for creating a new reusable record transform in Nexla.
2.1 Create a New Reusable Record Transform
Navigate to the screen in the section.
Select the tab.
Click to open the Create Record Transform screen.
2.2 Record Transform Name & Description
In the Create Record Transform screen, enter a name for the custom record transform in the text field at the top of the center panel.
Enter a brief description of the custom record transform in the Description text field below the transform name.
Text entered in this field will appear as the record transform summary in the pulldown menu in the Nexset Designer.
Optional: Click 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 record 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.
- Click to save the entered information and close the Documentation drawer.
2.3 Define the Transform Function
Select the language that will be used for the record transform by clicking the Python, JavaScript, or Nexla JSON button at the top of the Function Code box.
Enter the record transform code in the Function Code text box using the language format selected in Step 1.
Record Transform FormattingTransform Code Format:
The record transform function signature follows the format oftransform(input, metadata, args)
. Record transform functions receive the entire Nexset record as input and any metadata information about the record as metadata.Reference Existing TransformsWhen creating a custom record transform, any existing custom record transform accessible to the account can be referenced using the Record Transforms panel on the left side of the screen.
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 record transform.
2.4 Test the Transform Function
Once the custom record 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.
Enter or select sample data with which the custom record 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:
In the Test Sample Input box at the bottom of the center panel, click the button.
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.
To filter listed Nexsets by name, enter the full or partial Nexset name in the text field at the top of the window.
Select a Nexset by clicking the option button to the left of it.
Click the button in the bottom right corner of the window to load a sample record from the selected Nexset into the Test Sample Input box.
- Enter Sample Data Manually:
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.
Click the button at the top of the Function Code box—where the custom transform code was entered in Section 2.3— to apply the transform to the sample data.
The output data resulting from applying the custom transform to the sample data will be shown in the Generated Output panel on the right side of the screen.
2.5 Save the Reusable Record Transform
Once the custom record transform has been entered and tested to confirm that it produces the expected output, click in the top right corner of the screen to save and create the transform.
infoThe reusable record transform will now be accessible to the owner in the Nexset Designer. To learn how to share reusable record transforms with other users, see Section 4.
3. Use a Reusable Record Transform
In the Nexset Designer, click in the Nexset Rules panel, and select from the menu that appears.
Use the pulldown menu in the new rule group to select the desired reusable record transform.
infoReusable record transforms to which users have access will be listed under the "Your Reusable Transforms" category (below the code-selection options) in the menu.
Once a reusable record transform is selected, its name will be displayed at the top of the rule group, and its code will be shown below the pulldown menu.
Click to generate output samples in the Nexset Output panel.
Click in the top right corner of the screen at any point to save the current transform progress. Once the transform is complete, click to save the transform and close the Nexset Designer.
4. Share a Reusable Record Transform
To share a reusable record transform, navigate to the screen in the section, and select the tab.
Record Transforms TabIn the Record Transforms tab, all reusable record transforms accessible to the user can be viewed.
By default, custom record transforms owned by the user are shown. To view shared transforms, change the value of theaccess
keyword tocollaborator
in the search bar at the top of the screen.
Click on the transform to be shared to open its information drawer, and select the Access tab.
Use the pulldown menu on the left to select the user, group, or email address with whom the transform will be shared.
Choose the level of access that will be granted to the selected user(s) from the pulldown menu on the right.
Click the button to share the reusable record transform with the user(s) at the selected access level.
- The shared reusable record transform will now be accessible to the selected user(s) in the Nexset Designer.
5. Edit a Reusable Record Transform
When a reusable record transform is applied to a Nexset, that Nexset references the applied transform resource. Because the Nexset references the record transform resource, any changes to a reusable record transform are automatically applied to any Nexsets currently referring to that transform.
Therefore, use caution when editing a custom reusable record transform, as edits will affect existing Nexsets/data flows using the transform.
To edit a reusable record transform, navigate to the screen in the section, and select the tab.
Access LevelsUsers can only edit owned reusable record transforms and those to which they have been granted Administrator access.
Click on the transform to be edited, and select from the dropdown menu.
In the Edit Record Transform screen, users can make any necessary edits to the transform code, name, and description.
Testing Edited TransformsWhen editing the code of a custom reusable record 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.
Once all edits are complete, click in the top right corner of the screen to save the changes to the reusable record transform.