Forum Discussion
How to set the csv file encoding?
Hi SQLMonger ,
how can i add encoding of UT-8 for below query.
let
Source = SharePoint.Files("ABC", [ApiVersion = 15]),
#"Filtered Rows" = Table.SelectRows(Source, each ([Folder Path] = "ABCD" or [Folder Path] = "ABCD1" or [Folder Path] = "ABCD2" or [Folder Path] = "ABCD4")),
#"Filtered Hidden Files1" = Table.SelectRows(#"Filtered Rows", each [Attributes]?[Hidden]? <> true),
#"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File", each #"Transform File"([Content])),
#"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
#"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File"}),
#"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File", Table.ColumnNames(#"Transform File"(#"Sample File"))),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Table Column1",{{"Source.Name", type text}, {"id", type text}, {"category_level_1", type text}, {"category_level_2", type text}, {"category_level_3", type text}, {"category_level_1_old", type text}, {"category_level_2_old", type text}, {"category_level_3_old", type text}, {"parent_supplier", type text}, {"child_supplier", type text}, {"organization_level_1", type text}, {"organization_level_2", type text}, {"organization_level_3", type text}, {"organization_level_4", type text}, {"organization_level_5", type text}, {"cost_center_code", type text}, {"cost_center_name", type text}, {"general_ledger_code", type text}, {"general_ledger_name", type text}, {"line_description", type text}, {"invoice_id", type text}, {"invoice_number", type text}, {"accounting_date", type text}, {"invoice_date", type text}, {"invoice_amount", Int64.Type}, {"invoice_amount_with_tax", Int64.Type}, {"po_number", type text}, {"po_item", type text}, {"country", type text}, {"entity", type text}, {"country_code", type text}, {"supplier", type text}, {"supplier_type", type text}})
in
#"Changed Type"
This is not in this query. Find Transform File query created automatically by PBI (it would be in some group with a long name). You need to change it in this query at a step calling Csv.Document function.
Kind regards,
JB