You are here:
Overriding Metadata Generated by a Transformation
Optionally, you can override the metadata that is generated by a transformation. You can override object and field attributes. For example, you can change a field name that is extracted from a Salesforce object so that it appears differently in the dataset. To override the metadata, add the overrides to the Schema section of the transformation in the dataflow definition file.
Required Editions
| Available in: Salesforce Classic and Lightning Experience |
| Available for an additional cost in: Enterprise, Performance, and Unlimited Editions |
In the Schema section, you can override the metadata attributes for one object only.
The Schema section in this sample sfdcDigest transformation contains metadata overrides:
"Extract_Opportunities": {
"action": "sfdcDigest",
"parameters": {
"object": "Opportunity",
"fields": [
{ "name": "Name" },
{ "name": "Amount" }
]
},
"schema": {
"objects": [
{
"label":"Sales Opportunities",
"fields": [
{
"name": "Amount",
"label": "Opportunity Amount"
}
]
}
]
}
}Object Attributes
You can override the following object attributes.
| Object Attribute | Type | Description |
|---|---|---|
label
|
String | The display name for the object. Can be up to 40 characters. Example:
|
description
|
String | The description of the object. Must be less than 1,000 characters. Example:
|
fields
|
Array | The array of fields for this object. |
Field Attributes
You can override attributes of each specified dataset field.
| Field Attribute | Type | Description |
|---|---|---|
name
|
String | Name of the field in the dataset. Identifies the field that you want to override. Examples:
|
label
|
String | The display name for the field. Can be up to 255 characters. Example:
|
description
|
String | The description of the field. Must be less than 1,000 characters. Add a description to annotate a field in the dataflow definition file. This description is not visible to users in the Analytics user interface. Example:
|
isSystemField
|
Boolean | Indicates whether this field is a system field to be excluded from query results. Example:
|
format
|
String | The display format of the numeric value. Example:
For more information about valid formats, see Numeric Formats. |
Numeric Formats
An example of a typical numeric value is $1,000,000.99, which is
represented as $#,##0.00 in the format field. You’re
required to specify the precision and scale of the number. The format is specified by using
the following symbols:
| Symbol | Meaning |
|---|---|
| 0 | One digit. Use to add leading or trailing 0s, like #,###.00 for $56,375.00. |
| # | Adds zero or one digit |
| . | Default symbol used as the decimal separator. Use the decimalSeparator field to set the decimal separator
to a different symbol. |
| - | Minus sign |
| , | Grouping separator. Use the groupSeparator field to set the group separator to a different
symbol. |
| $ | Currency sign. Use the currencySymbol
field to set the currency indicator to a different symbol. |
Valid characters when defining a numeric format are:
- 0
- #
- ,
- -
- ,
- $
Let’s consider an example where you want to override the following object and field attributes that the sfdcDigest transformation extracts from the Opportunity object.
| Object/Field | Attribute Changes |
|---|---|
| Opportunity object |
|
| Id field |
|
| Amount field |
|
| CloseDate field |
|
To override the attributes, you add the Schema section with the override values to sfdcDigest in the dataflow definition file.
{
"Extract_Opportunities": {
"action": "sfdcDigest",
"parameters": {
"object": "Opportunity",
"fields": [
{ "name": "Id" },
{ "name": "Name" },
{ "name": "Amount" },
{ "name": "StageName" },
{ "name": "CloseDate" },
{ "name": "AccountId" },
{ "name": "OwnerId" }
]
},
"schema": {
"objects": [
{
"label":"Sales Opportunities",
"description": "These are all sales opportunities.",
"fields": [
{
"name": "Id",
"label": "Opportunity Id",
"isSystemField": true
},
{
"name": "Amount",
"label": "Opportunity Amount",
"format": "$#,##0.00"
},
{
"name": "CloseDate",
"label": "Closing Date"
}
]
}
]
}
},
"Register_Dataset_Opportunities": {
"action": "sfdcRegister",
"parameters": {
"source": "Extract_Opportunities",
"alias": "Opportunities",
"name": "Opportunities"
}
}
} "CalcAmountAfterdiscount": {
"action": "computeExpression",
"parameters": {
"mergeWithSource": true,
"source": "getOpps",
"computedFields": [
{
"name": "DiscountedAmount",
"label": "Discounted Amount",
"type": "Numeric",
"saqlExpression": "Amount * Discount_Percentage__c",
"precision": 10,
"scale": 2
}
]
}
},
