Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Latest commit

 

History

History
23 lines (20 loc) · 848 Bytes

Record.FieldOrDefault.md

File metadata and controls

23 lines (20 loc) · 848 Bytes

Record.FieldOrDefault

Returns the value of the specified field in a record or the default value if the field is not found.

function (record as record, field as text, optional defaultValue as nullable any) as nullable any

Description

Returns the value of the specified field field in the record record. If the field is not found, the optional defaultValue is returned.

Category

Record.Selection

Examples

Find the value of field "Phone" in the record, or return null if it doesn't exist.

Record.FieldOrDefault([CustomerID =1, Name="Bob"], "Phone")

null


Find the value of field "Phone" in the record, or return the default if it doesn't exist.

Record.FieldOrDefault([CustomerID =1, Name="Bob"], "Phone", "123-4567")

"123-4567"