Record functions

These functions create and manipulate record values.

Information

Name Description
Record.FieldCount Returns the number of fields in a record.
Record.HasFields Returns true if the field name or field names are present in a record.

Transformations

Name Description
Geography.FromWellKnownText Translates text representing a geographic value in Well-Known Text (WKT) format into a structured record.
Geography.ToWellKnownText Translates a structured geographic point value into its Well-Known Text (WKT) representation.
GeographyPoint.From Creates a record representing a geographic point from parts.
Geometry.FromWellKnownText Translates text representing a geometric value in Well-Known Text (WKT) format into a structured record.
Geometry.ToWellKnownText Translates a structured geometric point value into its Well-Known Text (WKT) representation.
GeometryPoint.From Creates a record representing a geometric point from parts.
Record.AddField Adds a field from a field name and value.
Record.Combine Combines the records in a list.
Record.RemoveFields Returns a new record that reorders the given fields with respect to each other. Any fields not specified remain in their original locations.
Record.RenameFields Returns a new record that renames the fields specified. The resultant fields will retain their original order. This function supports swapping and chaining field names. However, all target names plus remaining field names must constitute a unique set or an error will occur.
Record.ReorderFields Returns a new record that reorders fields relative to each other. Any fields not specified remain in their original locations. Requires two or more fields.
Record.TransformFields Transforms fields by applying transformOperations. For more more information about values supported by transformOperations, go to Parameter Values.

Selection

Name Description
Record.Field Returns the value of the given field. This function can be used to dynamically create field lookup syntax for a given record. In that way it is a dynamic version of the record[field] syntax.
Record.FieldNames Returns a list of field names in order of the record's fields.
Record.FieldOrDefault Returns the value of a field from a record, or the default value if the field does not exist.
Record.FieldValues Returns a list of field values in order of the record's fields.
Record.SelectFields Returns a new record that contains the fields selected from the input record. The original order of the fields is maintained.

Serialization

Name Description
Record.FromList Returns a record given a list of field values and a set of fields.
Record.FromTable Returns a record from a table of records containing field names and values.
Record.ToList Returns a list of values containing the field values of the input record.
Record.ToTable Returns a table of records containing field names and values from an input record.

Parameter Values

The following type definitions are used to describe the parameter values that are referenced in the Record functions above.

Type Definition Description
MissingField option More information: MissingField.Type
Transform operations Transform operations can be specified by either of the following values:

•  A list value of two items, first item being the field name and the second item being the transformation function applied to that field to produce a new value.

•  A list of transformations can be provided by providing a list value, and each item being the list value of 2 items as described above.

For examples, go to the description of Record.TransformFields
Rename operations Rename operations for a record can be specified as either of:

A single rename operation, which is represented by a list of two field names, old and new.

For examples, go to the description of Record.RenameFields.