Record.RenameFields
Syntax
Record.RenameFields(record as record, renames as list, optional missingField as nullable number) as record
About
Returns a record after renaming fields in the input record
to the new field names specified in list renames
. For multiple renames, a nested list can be used ({ {old1, new1}, {old2, new2} }.
Example 1
Rename the field "UnitPrice" to "Price" from the record.
Usage
Record.RenameFields(
[OrderID = 1, CustomerID = 1, Item = "Fishing rod", UnitPrice = 100.0],
{"UnitPrice", "Price"}
)
Output
[OrderID = 1, CustomerID = 1, Item = "Fishing rod", Price = 100.0]
Example 2
Rename the fields "UnitPrice" to "Price" and "OrderNum" to "OrderID" from the record.
Usage
Record.RenameFields(
[OrderNum = 1, CustomerID = 1, Item = "Fishing rod", UnitPrice = 100.0],
{
{"UnitPrice", "Price"},
{"OrderNum", "OrderID"}
}
)
Output
[OrderID = 1, CustomerID = 1, Item = "Fishing rod", Price = 100.0]
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho