Skip to main content

Table.FromValue

Creates a table with a column from the provided value(s).

Syntax

Table.FromValue(
value as any,
optional options as record
) as table

Remarks

Creates a table with a column containing the provided value or list of values, value. An optional record parameter, options, may be specified to control the following options:

  • DefaultColumnName : The column name used when constructing a table from a list or scalar value.

Examples

Example #1

Create a table from the value 1.

Table.FromValue(1)

Result:

Table.FromRecords({[Value = 1]})

Example #2

Create a table from the list.

Table.FromValue({1, "Bob", "123-4567"})

Result:

Table.FromRecords({
[Value = 1],
[Value = "Bob"],
[Value = "123-4567"]
})

Example #3

Create a table from the value 1, with a custom column name.

Table.FromValue(1, [DefaultColumnName = "MyValue"])

Result:

Table.FromRecords({[MyValue = 1]})

Category

Table.Table construction