Forum Discussion
How to reference list of lists in Table.RenameColumns function?
- 3 years ago
Hi Anonymous ,
just omit the merge step and you should be good to go:let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WilHyz0nxS8xNNYxRUtIBcv1Sy2HcWB0keSNUeSN0eWNUeRA3NhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [OldNames = _t, NewNames = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"OldNames", type text}, {"NewNames", type text}}), #"create list of lists" = Table.ToRows(#"Changed Type") in #"create list of lists"
By merging the columns, you are creating one string that will then become a list with just one element.
But you need a list with 2 elements in it. So omitting the merge will just solve the issue.
Hi Anonymous ,
just omit the merge step and you should be good to go:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WilHyz0nxS8xNNYxRUtIBcv1Sy2HcWB0keSNUeSN0eWNUeRA3NhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [OldNames = _t, NewNames = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"OldNames", type text}, {"NewNames", type text}}),
#"create list of lists" = Table.ToRows(#"Changed Type")
in
#"create list of lists"
By merging the columns, you are creating one string that will then become a list with just one element.
But you need a list with 2 elements in it. So omitting the merge will just solve the issue.
Hi Imke --
The example I provided you worked after I made that adjustment in my query. But when I ran the same steps on my actual data, I am still getting the same error, even though I have a nested list:
Expression.Error: We expected a RenameOperations value.
Details:
[List]
For some reason, my query doesn't seem to recognize that the query with my nested list is a list.