1

I'm using a dataflow to bring in Salesforce record data but I would like to rename the columns in my dataset from their Salesforce API name ("SAP_Territory_Name__c") to another name ("Territory"), not just the labels displayed in Wave, but the column headings of the data. I would expect you can do this in the dataflow json but cannot find out how this is done.

Any help much appreciated! Below is an extract of the dataflow JSON.

    "102": {
    "action": "sfdcDigest",
    "parameters": {
      "fields": [
        {
          "name": "Territory_Name__c"
        },
        {
          "name": "SAP_Territory_Name__c"
        },
        {
          "name": "Territory_Country__c"
        },
        {
          "name": "BillingCity"
        },
        {
          "name": "BillingState"
        },
        {
          "name": "BillingCountry"
        },
        {
          "name": "Name"
        },
        {
          "name": "Id"
        }
      ],
      "object": "Account"
    }
  },
1

You can rename the columns by editing/adding to the metadata XMD file (will be available to download in the edit page of your dataset).

Just add in the code below to the XMD File:

 {
  "labels":{
    "dimensions":{
         "SAP_Territory_Name__c": "Territory" 
    }
  } 
}

That is it, I hope it helps :)

  • Thanks for your reply - Unfortunately this only changes the Label and not the Name of the dimension. The Json will still reference SAP_Territory_Name__c and Territory will be displayed to the user. – Andrew Apr 11 '16 at 10:26
  • Oh, Okay. If you need to change the name, I guess changing the field name in Salesforce should help. – Raghavendhra Yarlagadda Apr 11 '16 at 15:44
1

I know this is a bit old, but if you or anyone else needs it, we achieved this using a computeExpression step in our dataflow. So like this:

{
"Derived_SalesforceObject": {

    "action": "computeExpression",

    "parameters": {

        "source": "Extract_SalesforceObject",

        "mergeWithSource": false,

        "computedFields": [
            {"name":"Territory","type":"Text","label":"Territory","saqlExpression":"SAP_Territory_Name__c"},
            {"name":"Territory_Country","type":"Text","label":"Territory Country","saqlExpression":"Territory_Country__c"}
         ]

    }

}

Note that the "mergeWithSource" parameter will determine if the original field(s) remain in the dataset after this action. So if you set this to False, be sure to include an entry under "computedFields" for each field you expect to have in your dataset.

In the above example, your resulting dataset would only include 2 fields.

0

Just pointing out that if we use the computeExpression approached outlined in an answer, it won't work for multi-value fields. We will get the error "Something went wrong while executing the node: cannot use multi value field". This is one of the many limitations with multi-value fields listed here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.