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.
- Anonymous3 years agoNot applicable
ahh thank you! bonus question for you: do you know a quick way to wrap all strings in each cell in quotations? my actual dataset contains all the find and replace values but they are not wrapped in quotation marks, so they look like this: Oldval, Newval .. instead of this: "Oldval", "Newval"
- Anonymous3 years agoNot applicable
oh I think I got confused and thought I needed to add quotation marks. I will test things out on my end.
- Anonymous2 years agoNot applicable
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.