Functions (all)

Field

Function Name:
Field
Description:
Returns a particular field within a given record (or possibly, a subfield within another field such as a Fact field). You pass in a reference to the record (or 'starting' node) as one parameter, and a data reference constant (see below) in the second parameter.

Can also be used to find fields in other records - e.g. a person's mother-in-law. Is similar to the FieldText function, but this function is used to reference fields, and ignores qualifiers (see Understanding Data References for an explanation of the role of qualifiers). The FieldText function, because it returns a text value, will honour qualifiers.

This function is also similar to the GetField function. GetField is more flexible as you can use operators to construct the string. But this function is much faster to execute. Consequently, you are recommended to use this function for preference, but use GetField if you need the added flexibility that it offers.

Minimum FH Version:
4.0
No. of Parameters:
2
Return Type:
A reference to a data item (or NULL if none is found).
Parameter 1:
A datanode to use as a starting point. Usually a record.
Parameter 2:

A data reference constant. A data reference constant is different from a data reference. Ordinary data references have percentage signs around them. A data reference is replaced by the item it references when the function is evaluated. A data reference constant, however, has single quotes instead of the percentage signs, and is passed to the function unchanged when the function is evaluated (hence 'constant').

So, for example,

%INDI.DEAT.DATE%

is a data reference, whereas

'INDI.DEAT.DATE'

is a data reference constant.

A data reference constant is NOT a kind of string. Strings have double quotes around them. Data reference constants have single quotes.

Examples:

=Field(["Person"], 'INDI.DEAT.DATE')
=Field(%INDI.~SPOU>%, 'INDI.DEAT.DATE')