You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/protocols/transform/index.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,13 +117,15 @@ Here's a list of Segment Transformations with some use case examples.
117
117
118
118
-**Add a new property name and assign a value:** If you want to create a new property and set a static value, use [Segment's Public API](https://docs.segmentapis.com/tag/Transformations){:target="_blank"} to create `new_property: static_value`. Segment currently supports setting static values for top-level fields with `propertyValueTransformations`. However, Segment doesn't support changing fields outside the properties or traits object with `propertyRenames`.
119
119
120
-
-**Change property value casing:** Use [Segment's Public API](https://docs.segmentapis.com/tag/Transformations){:target="_blank"} to transform property value casing to lowercase, uppercase, snake case, kebab case, or title case. For example, transform the property value `united states` to `USA` to remain consistent with your data tracking. You can transform these properties using static casing functions (`"uppercase("United States")"`) or dynamic casing functions (`"lowercase(property value 1")"`).
121
-
122
-
-**Create a new property**: Use [Segment's Public API](https://docs.segmentapis.com/tag/Transformations){:target="_blank"} to create a new property and set the value of the new property to the transformed value of an existing property. For example, create a new property (`prop2`) with a value of `lowercase(properties.prop1)` by including `prop2: lowercase(properties.prop1)` in your payload.
123
-
124
-
-**Replace the value of a current property**: You can replace the property value of an existing property using static casing functions, for example `prop1: "titlecase(value 2)"`, or dynamic casing functions (`"prop1: kebabcase("properties.prop1")"`) with [Segment's Public API](https://docs.segmentapis.com/tag/Transformations){:target="_blank"}.
125
-
126
-
-**Change the value of a property if a user triggers an event:** Use [Segment's Public API](https://docs.segmentapis.com/tag/Transformations){:target="_blank"} to dynamically assign the value of one existing property to another property, or assign the value of an property to a new property. For example, you can assign a new property, `property2`, to have the same value as `property1` if a user clicks a button.
120
+
-** Property Transformations:**
121
+
-**Assigning static values:**
122
+
- If you want to create a new property and set a static value, use [Segment's Public API](<https://docs.segmentapis.com/tag/Transformations>){:target="_blank"} to create `new_property: static_value`. Segment currently supports setting static values for top-level fields, as well as fields within the `context` or `properties` object with `propertyValueTransformations`. However, Segment doesn't support changing fields outside the properties or traits object with `propertyRenames`.
123
+
- You can use assign `propertyValueTransformations` a single object to target different fields to assign the same value or multiple objects to target differnt fields with their own static values.
124
+
-**Casing functions:** Use [Segment's Public API](<https://docs.segmentapis.com/tag/Transformations>){:target="_blank"} to transform property value casing to `lowercase, uppercase, snakecase, kebabcase, or titlecase`. You can use `fqlDefinedProperties` to define the `fql` (with or without casing functions) you want to use to and the `propertyName` to apply it towards (this can be an existing property name or a new one).
125
+
-**Static and Dynamic Value Casing:** For example, transform the property value `united states` to `USA` to remain consistent with your data tracking. You can transform these properties using static casing functions (`fqlDefinedProperties": [{"fql": "uppercasecase("United States)", "propertyName": "properties.propertyValue1"}]`) or dynamic casing functions (`fqlDefinedProperties": [{"fql": "lowercase(properties.propertyValue1)", "propertyName": "properties.propertyValue1"}]`).
126
+
-**Create a new property with casing applied value**: Use [Segment's Public API](<https://docs.segmentapis.com/tag/Transformations>){:target="_blank"} to create a new property and set the value of the new property to the transformed value of an existing property. For example, create a new property (`prop2`) with a value of `lowercase(properties.prop1)` by including `fqlDefinedProperties": [{"fql": "lowercase(properties.prop1)", "propertyName": "properties.prop2"}]` in your payload.
127
+
- You can dynamically assign the value of one existing property to another property, or assign the value of an property to a new property without applying casing functions.
128
+
- Note that you can only assign one property to `fqlDefinedProperties` array.
127
129
128
130
> info ""
129
131
> Segment displays an error if the following property conflicts occur:
0 commit comments