Forum Discussion
XML input - how to handle missing tables
- 4 years ago
I think I found a solution. I created a dummy query that holds the optional XML elements. I then appended the dummy query....
let
Source = Xml.Tables(File.Contents(SavedXML)),
#"Appended Query" = Table.Combine({Source, Dummy_XML}),...which worked if the XML was missing. If the XML already had the element, I ended up with a duplicate row that I removed using
#"Removed Duplicates" = Table.Distinct(#"Appended Query",{"Name"}),Seems to do the job.
Hi AlexHeinze ,
Are you importing an empty table as shown below?
Perhaps you can select the "Source" step in the already imported table and then you will be able to see the empty table.
Best Regards,
Winniz
- AlexHeinze4 years agoFrequent Visitor
I think I found a solution. I created a dummy query that holds the optional XML elements. I then appended the dummy query....
let
Source = Xml.Tables(File.Contents(SavedXML)),
#"Appended Query" = Table.Combine({Source, Dummy_XML}),...which worked if the XML was missing. If the XML already had the element, I ended up with a duplicate row that I removed using
#"Removed Duplicates" = Table.Distinct(#"Appended Query",{"Name"}),Seems to do the job.