The number of field values does not match the number of header fields on line2
The number of field values does not match the number of header fields on line2, this is the error if i have fields with empty values, any workarounds ?
Any update on this having the same issue, Is this the issue because we have empty values ?
@ktheralaSFDC @chaitanyakurella From custom_md_loader/classes/MetadataUtil.cls remove lines 90-92
if (String.isBlank(singleRowFieldValues)) {
continue;
}
A few more gotchas that seem to trigger this problem: make sure you don't have any text fields whose values contain delimiter characters. Probably not an exhaustive list, but I think these characters cause issues in text fields:
- comma (,)
- semi-colon (;)
- single-quote (')
- double-quote (")
I had to remove these from my batch upload, then manually re-enter the values afterwards.
In addition, Number and Percent fields do not seem to handle blank values in the CSV. All types of Text fields can be blank, as can Boolean and Picklist. For my number fields, I inputted an easy-to-identify number that matched the range (like 999), then manually deleted these values after the upload. Not sure about some of the more exotic fields like URL, but if you are still hitting the problem I would experiment with adding placeholder values field type by field type to see if there is another one besides number that's causing problems.
When I try to update a string field with blanks, I get "The number of field values does not match the number of header fields on line1", how do I update to blanks (empty values)?
Duplicate of https://github.com/forcedotcom/CustomMetadataLoader/issues/9