1

CSV file:

"id","name"
"00134535345343542X","Walmart"
"001342323423423232","Amazon"

Metadata JSON file:

{
    "fileFormat": {
    "charsetName": "UTF-8",
    "fieldsEnclosedBy": "\"",
    "fieldsDelimitedBy": ",",
    "numberOfLinesToIgnore": 1
  },
  "objects": [
  {
        "connector": "CIConnector",
        "description": "",
        "fullyQualifiedName": "CSVData",
        "label": "CSV Data",
        "name": "CSVData",
        "fields": [
        {
            "description": "",
            "fullyQualifiedName": "CSVData.Name",
            "label": "Acc Name",
            "name": "Name",
            "isSystemField": false,
            "isUniqueId": false,
            "isMultiValue": false,
            "type": "Text"
        },
        {
            "description": "",
            "fullyQualifiedName": "CSVData.Id",
            "label": "Acc Id",
            "name": "Id",
            "isSystemField": true,
            "isUniqueId": true,
            "type": "Text"
        }
     ]
    }
  ]
}

When uploading the data using InsightsExternalData API, I am receiving the below error:

Error executing node digest: field-count, 2, and header's column-count, 1, do not match (02K34534523223231M_03C23423423243231A)

I created the CSV data and Metadata JSON following the documentation mentioned in this link

Clearly I have two fields in header and on every line, I have two fields.. Any help on this?

NOTE: I am receiving this error only when loading the data using Cast Iron and It loads fine if I load the above files in UI.

7
  • You have specified the name (and id) like this: CSVData.Name, CSVData.Id - yet in the csv file you have named them name and id. If the parser is case sensitive, this will cause an error (I'm not able to determine if this is the case) Aug 23, 2016 at 2:31
  • Also, I notice that the example provided here: developer.salesforce.com/docs/… does not enclose the csv values in quotes, but you do. I think this is ok, but it's safest to stick to the example exactly Aug 23, 2016 at 2:34
  • If I don't enclose data in quotes, how do I handle situations where account name has comma in it: ex: Wal,mart
    – javanoob
    Aug 23, 2016 at 2:36
  • Sure, I think it's fine. Try my first suggestion - it's all I can see at the moment. Aug 23, 2016 at 2:37
  • Another thing you can do is leave out the metadata file altogether - if you are only using those two fields, it probably isn't needed - the docs say it's optional. Aug 23, 2016 at 2:41

1 Answer 1

0

Just wanted to posted on how I solved this. If you upload the above csv file and metadata from UI, it loads fine but it was failing for me when trying to load using Cast Iron.

Here is the documentation on Cast Iron website on how to load csv file into salesforce wave.

Link: http://www.ibm.com/support/knowledgecenter/SSGR73_7.5.1/com.ibm.wci.doc/Salesforce_analytics_connector_LoadData_Activity.html

enter image description here

It says that the dataFile should be base64 encoded but it is not required.

The error in salesforce wave was kind of misleading and led me thinking that there was something wrong with the header but the fact is that it was trying to load the base64 encoded data.

Once I mapped the raw csv data to the field 'DataFile' on the object 'InsightsExternalDataPart' object, it loads fine.

I guess Cast Iron, internally encodes the file so we don't need to do explicitly.

Hope this helps future readers. Thanks!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .