Forum Discussion

henriquelima's avatar
henriquelima
Regular Visitor
8 years ago
Solved

column name

how can I get the column name of a table and after that use as a parameter?
  • Anonymous's avatar
    Anonymous
    8 years ago

    Hi, 

     

    The important step is:

     

    #"Columns" = Table.ColumnNames(#"Changed Type")

     

    This is the M code of the example.

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i44FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}}),
        #"Columns" = Table.ColumnNames(#"Changed Type")
    in
        #"Columns"

    Regards.