# Power Query - select all columns



## zico8 (Aug 4, 2017)

how can I select all columns in PQ for changing them type to text?

I wold like to be up to date even if I add some data and then query will have more columns.


----------



## MarcelBeug (Aug 4, 2017)

Use Table.ColumnNames to get a list all column names from a table.
If you transform this into a list of lists, with each item consisting of (1) the column name and (2) type text, then you can use this list to transform all table columns to text:

```
let
    MyTable = #table(100,{{1..100}}),
    ColumnNames = Table.ColumnNames(MyTable),
    TransformList = List.Transform(ColumnNames, each {_, type text}),
    MyTypedTable = Table.TransformColumnTypes(MyTable,TransformList)
in
    MyTypedTable
```


----------

