Functions (all)

FieldText

Function Name:
FieldText
Description:
Returns the value of a particular field within a given record (or possibly, a subfield within another field such as a Fact field) as text. 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 the data stored in fields in other records - e.g. a person's mother-in-law's surname. Is similar to the Field function, but that function is used to reference fields, and ignores qualifiers (see Understanding Data References for an explanation of the role of qualifiers). This function, because it returns a text value, will honour qualifiers.

This function is also similar to the GetFieldText function. GetFieldText 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 GetFieldText if you need the added flexibility that it offers.

Minimum FH Version:
4.0
No. of Parameters:
2
Return Type:
Text
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:

=FieldText(["Person"], 'INDI.DEAT.DATE')
=FieldText(%INDI.~SPOU>%, 'INDI.NAME:SURNAME')