Medium severitydata quality
Power BI Refresh Error:
DF-Xml-InvalidDataField
What does this error mean?
The XML source contains a field that cannot be mapped to the ADF dataset schema. The field name doesn't match, or the value type is incompatible with the mapped column.
Common causes
- 1The XML source file has a different element or attribute name than what is defined in the ADF dataset schema
- 2The XML namespace in the file does not match the namespace defined in the dataset settings
- 3A field in the XML contains a value that cannot be cast to the target data type — for example, an element mapped to an integer that contains the text 'N/A'
- 4The XML structure changed (element renamed or restructured) but the dataset schema was not refreshed
- 5A repeated element (array) is being mapped as a single value, causing a type conflict
How to fix it
- 1Read the error detail in the ADF activity run output — it names the field and the value that caused the failure.
- 2Open the XML dataset in ADF Studio and click Import Schema — this re-reads the current XML file structure and updates the schema to match the actual file.
- 3In debug mode, run a Data Preview on the XML source to see the actual field names and values being read.
- 4Compare the field name in the error with the element names in the XML file — check for namespace prefixes, case differences, and attribute vs element notation.
- 5If the field contains an unexpected value type (e.g., empty string mapped to integer), add a Derived Column transformation after the source to cast it safely: toInteger(iifNull(fieldName, '0')).
- 6If the XML structure uses namespaces, verify the namespace URI in the dataset matches the xmlns declaration in the actual XML files.
Frequently asked questions
Official documentation: https://learn.microsoft.com/en-us/azure/data-factory/data-flow-troubleshoot-guide