Forum Discussion
Strange behaviour when connection to a REST Api
- 10 years ago
Thanks for your XML samples. :) I've observed that strange behavior, the column is expanded as a table when the element in XML is blank otherwise as a normal string.
In my opinion it is really an abnormal behavior. I will report this internally and post back if there comes any update. One workaround so far I can think of.
#"Added Custom" = Table.AddColumn(#"Expanded Details1", "Type", each try Text.From([Details.Type]) otherwise "")
Thanks again for your feedback.:)
Thanks sooooo much for that soooooo detailed post, I've learnt a lot Power Query from it. :)
The details are added to the original table as a column, and when I try to expand this column (which of course is of type table), the field ORDERTYPE is sometimes empty - then it's loaded as a table (?), and somtimes it has a text value (for instance RENTAL) - then it's loaded a type text.
So according to your description, that column is from Xml.Tables(Web.Contents(url)), have you checked that the API call always returns a valid/same formated xml? What does the API call return for the problematic records in your case?
I'll have a look into it. I can try to send you two xml-files, one from a problematic post and one from a non-problematic. I'll try to look into it through the day
- Eric_Zhang10 years agoMicrosoft Employee
Thanks for your XML samples. :) I've observed that strange behavior, the column is expanded as a table when the element in XML is blank otherwise as a normal string.
In my opinion it is really an abnormal behavior. I will report this internally and post back if there comes any update. One workaround so far I can think of.
#"Added Custom" = Table.AddColumn(#"Expanded Details1", "Type", each try Text.From([Details.Type]) otherwise "")
Thanks again for your feedback.:)