Forum Discussion

johnjbolduc's avatar
johnjbolduc
Icon for Helper II rankHelper II
1 year ago

Skip parsing blank XML

I have several XML columns in a table, but they can sometimes have no content. I either need to be able to:

 

1. Transform the XML column, but have Power Query be smart enough to skip blanks or at least not error out on a blank value.

 

OR

 

2. Be able to create a blank or dummy XML string that can be successfully parsed by Power. I've tried many variations such as:

The last variation is to try to match the XML cells with data.

 

All variations pass mutiple XML validators as valid XML, but all throw this same error when parsed in Power Query:

DataFormat.Error: Xml processing failed. Either the input is invalid or it isn't supported. (Internal error: Root element is missing.)

 

How am I missing a root element? How do I fix this? Thanks.