Record.AddField

 

This topic applies to the Power Query Formula Language which can be used with Power Query and Power BI Desktop to build queries that mashup data. See the list of function categories.

Adds a field from a field name and value.

Record.AddField (record as record, fieldName as text, value as any,optional delayed as nullable logical) as record  

ArgumentDescription
recordThe Record to modify.
fieldNameThe value to name the field.
valueThe value to add to the field.
optional delayedIndicates whether the field value or a function that computes the field value.
Record.AddField( [CustomerID = 1, Name = "Bob", Phone = "123-4567"] , "Address", "123 Main St.")  

equals [CustomerID=1, Name= "Bob", Phone="123-4567", Address="123 Main St."]  

CustomerID1
Phone123-4567
Address123 Main St.
Show: