Using custom script transformations

Introduction

What are custom script transformations and what can they do?

A custom script transformation is made up of one or more versatile instructions that tell Adverity how to transform your data. You can use custom script transformations to add or remove fields from your data, perform calculations, convert data, and much more.

How do I use custom script transformations?

Create a custom script transformation as described in this guide. Transformations can be assigned to multiple datastreams. Every time you fetch data using the datastream the transformation is assigned to, the collected data is transformed according to the instructions in the transformation.

Use Adverity's AI-powered Transformation Copilot to create custom script transformations quickly and easily. For more information, see Using the Transformation Copilot.

Who can use a transformation that I create?

A transformation is available to all users with access to the workspace where the transformation was created. However, the transformation will only affect datastreams to which it is assigned.

What instructions can I add to a custom script transformation?

You can add as many instructions as you want to a custom script transformation and configure the settings for each instruction individually. You can find a list of all available custom script instructions here.

What other transformation types are there in Adverity?

Adverity also offers standard transformations, which provide a user-friendly interface that lets you tell Adverity how to transform your data within a certain framework. For more information, see Using standard transformations.

Creating a custom script transformation

The process of creating a custom script transformation is made up of the following steps:

  1. Type: Choose to create a custom script transformation.

  2. Assignments: Choose the datastreams to which you want to apply the transformation.

  3. Configuration: Create the custom script transformation by adding and configuring instructions so that it transforms your data according to your needs.

  4. Name: Give your custom script transformation a name so it is easily identifiable.

Prerequisites

Before you complete the procedure in this guide, perform all of the following actions:

Creating a custom script transformation

To get started creating a transformation, follow these steps:

  1. Go to the Transformations page.

  2. In the top right corner, click + Create transformation.

  3. In the Type step, click Custom script.

    This guide only explains how to create a custom script transformations. To create a standard transformation, see Using standard transformations.

  4. In the Assignments step, select the datastreams to which you want to assign this transformation:

    • To assign the transformation to one or more specific datastreams, select Individual datastreams and then select your chosen datastreams from the drop-down menu.

    • To assign the transformation to all datastreams that fetch data from one or more specific data sources, select Datastream types and then select your chosen data sources from the drop down menu.

      (Optional) To exclude any datastreams that fetch data from your chosen data source, select the individual datastreams to exclude from the Do not assign to these individual datastreams drop-down menu.

  5. In the Configuration step, in the Select instruction... drop-down menu, enter and select an instruction for this transformation.

    Use the Transformation Copilot to get the transformation instruction and its configuration for your specific use case. For more information, see Using the Transformation Copilot.

  6. Configure the settings for the instruction you have selected according to the Copilot's response or the corresponding instruction guide.

    You can preview your transformation in the Preview tab. Here, you can see how your current transformation instructions will transform the data you have previously collected using the selected datastream.

    Click Refresh Preview at the bottom of the Configuration tab to see the preview of your latest changes.

    For more information about the preview, see Previewing transformations.

  7. (Optional) To add more instructions to this transformation, click + Add instruction and configure the corresponding settings.

    Repeat this step until you have finished adding and configuring instructions.

  8. Click Next.

  9. In the Name step, enter a name and a description for your transformation.

  10. Click Create.

As a result, you have created a custom script transformation and assigned it to your chosen datastreams. From now on, every time you fetch data using these datastreams, the data extract will be transformed according to the instructions in your transformation.

You can also assign your transformations to a datastream from the datastream overview as well as manage the order in which the transformations are applied.

Editing a custom script transformation

You can edit a transformation after it has been created. To do so, follow these steps:

  1. Go to the Transformations page.

  2. Click the transformation you want to edit.

  3. You will automatically be taken to the Instructions page of the transformation overview. Make any required changes to the transformation configuration here.

  4. To change the list of datastreams to which the transformation is assigned, go to the Used by tab.

  5. Click Save.

As a result, you have edited your custom script transformation. From now on, when you fetch data using a datastream to which this transformation is assigned, your data will be transformed according to the new instructions.