Table.TransformColumnTypes

Syntax

Table.TransformColumnTypes(table as table, typeTransformations as list, optional culture as nullable text) as table

About

Returns a table from the input table by applying the transform operation to the columns specified in the parameter typeTransformations (where format is { column name, type name}), using the specified culture in the optional parameter culture (for example, "en-US"). If the column doesn't exist, an exception is thrown.

Example 1

Transform the number values in column [a] to text values from the table ({[a = 1, b = 2], [a = 3, b = 4]}).

Usage

Table.TransformColumnTypes(
    Table.FromRecords({
        [a = 1, b = 2],
        [a = 3, b = 4]
    }),
    {"a", type text},
    "en-US"
)

Output

Table.FromRecords({
    [a = "1", b = 2],
    [a = "3", b = 4]
})