Forum Discussion
DenHaa
4 years agoFrequent Visitor
Issue when importing CSV file
Hello. I am having an issue when I am importing a CSV-file through the Web query as it limits the amount of columns for some reason. The first time I imported the CSV it had 16 columns, I have s...
negi007
4 years agoCommunity Champion
DenHaa your code is slighlty different. i have just imported the file and was able to get new columns using below code. Can you try using it.
let
Source = Csv.Document(Web.Contents("https://abc/xyz.csv"),[Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true])
in
#"Promoted Headers"
DenHaa
4 years agoFrequent Visitor
The only change I could see was the Encoding, correct?
When I changed the Encoding to 1252, all of the 26 columns show up when I refresh but they still give an error:
And if I try to change the type of one of the fields, I get the following error:
Here is my current query:
let
Source = Csv.Document(Web.Contents("$url"),[Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Assigned Date", type datetime}})
in
#"Changed Type"