Transformations

Modify your data before it's sent to destinations

Types of Transformations

Freshpaint supports two uses for transformations

Standard Mapping

Standard mappings are used to re-format the data you send to Freshpaint into the structure that a destination accepts and assigns special meaning to. For example, you can use transformations to rename your add_to_cart event that you're sending to Freshpaint into Facebook or Pinterest's AddToCart event.

Fix Bad Data

You can use transformations to modify the data Freshpaint sends to destinations in order to match historical data or remove sensitive information before they are sent to a destination.

Supported Operations

Rename Event
Rename Property
Change Property Type
Uppercase/Lowercase Property
Delete Property
Rename Event

Use this operation to rename the event. For example, if you have an event named order_complete, but you want this to be named OrderCompleted in a destination, you can use this operation.

You can only rename an event once. If you try to add two "Rename Event" operations to a given event + destination combination, you will receive an error.

You can not use this operation for transformations that do not target an event.

This would lead to you renaming every single event going to a specific destination.

Rename Property

Use this operation to rename a property. This is often used to fix typos without involving developers, or for fixing data to match historical data.

Example use cases:

Rename a property with a typo like referer to referrer

Rename the property cart_total to revenue

Change Property Type

Use this operation to convert between text, number, and true/false values of a property.

If a value cannot be converted to the desired type, it is left untouched.

Convert To Number

When converting a property into a number, we leave everything that is not text untouched. For text, we attempt to parse it as a decimal value, if it has characters that are non-numeric, it fails.

Initial Value

Initial Type

Result Value

Result Type

"-1"

Text

-1

Number

"24.6"

Text

24.6

Number

"$812.37"

Text

"$812.37"

Text

1

Number

1

Number

null

Null

null

Null

"button"

Text

"button"

Text

"$fourty-five"

Text

"$fourty-five"

Text

Convert To Text

When converting a property's value to text, we leave null and text values as-is, but convert objects, arrays, numbers and true/false values. For objects and arrays, we json-encode them without modifying the sub-element's types. For numbers and true/false values, we simply convert them to text as you'd expect.

Initial Value

Initial Type

Result Value

Result Type

true

True/False

"true"

Text

1

Number

"1"

Text

null

Null

null

Null

"button"

Text

"button"

Text

{x: 'yes', y: 23}

Object

'{"x": "yes", "y": 23}'

Text (json-encoded)

[1, 2, 3, "no", false]

Array

"[1, 2, 3, 'no', false]"

Text (json-encode)

Convert To True/False

When converting a property's value to True/False, all values besides the text values t, f, true and false (case insensitive) are let as-is.

Note: the numerical values of 0 and 1 are not converted to false or true

Initial Value

Initial Type

Result Value

Result Type

't'

Text

true

True/False

'f'

Text

false

True/False

'x'

Text

'x'

Text

'TrUe'

Text

true

True/False

'fAlse'

Text

false

True/False

'truthful'

Text

'truthful'

Text

true

True/False

true

True/False

false

True/False

false

True/False

0

Number

0

Number

42

Number

42

Number

Uppercase/Lowercase Property

Use these operations to convert the value of a property to upper or lower case. Useful for normalizing email addresses, or converting a currency property from usd to USD to match historical data.

Delete Property

Use this operation to delete an event property. This is often useful if you want to remove sensitive data from flowing into a third party destination.

Transformations Dashboard

From the transformation dashboard, you can view and edit your existing transformations, as well as launch the wizard to guide you through creating a new transformation.

Transformations are grouped into sets based on their Transformation Type, Freshpaint Event and Destination.

Creating a new transformation

You can launch the wizard to create a new transformation by clicking the button in the top right.

Add a new operation to a transformation

  1. Expand the transformation set you want to modify by clicking on it. If you just created a new transformation via the wizard, it will already be opened.

Expanding a transformation set

2. Click the + button and choose the operation you want to apply. See above for operation descriptions.

Deleting or modifying an operation

  1. Expand the transformation set that contains the operation you want to modify by clicking on it. If you just created a new transformation via the wizard, it will already be opened.

  2. Click on the operation you want to delete or modify. It will highlight and show a pencil icon as you hover over it.

  3. From here you can either change the attributes and click "Save" or delete the operation by clicking "delete."

Deleting an entire transformation set

You can delete an entire set of transformations by clicking on the trash icon on the right side of any transformation set.

‚Äč